Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Revision questions on Regular Expressions a) Explain the difference between greedy and non-greedy quantifiers in regular expressions. Think carefully, and show the first match (if

Revision questions on Regular Expressions

a) Explain the difference between greedy and non-greedy quantifiers in regular expressions. Think carefully, and show the first match (if any) that these patterns make. Briefly explain the match:

i) .+[a-f]

ii) .*?[a-f]

iii) .+?[a-f]

when applied to the string:

1476707729-5804c5642b2cf-52590

b) Write regular expressions to match the following patterns embedded in a document and briefly explain the match:

i) numbers between 99 and 9999999 (inclusive) with optional commas (e.g. 1,250)

ii) a national insurance number ( e.g. XP145237B or GG540672Y),

iii) words containing both 'in' and 'of' (e.g. spoofing, inoffending, kinofluous, coffin)

iv) five letter palindromes (words that are the same backwards as forwards) (e.g. kayak, dewed, refer)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

Students also viewed these Databases questions