Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Revision questions on regular expressions in Linux a) Explain the difference between greedy and non-greedy quantifiers in regular expressions. Think carefully, and show the first

Revision questions on regular expressions in Linux

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:

[l - r] {5,9}?

[l - r]+?

[l - r]+

when applied to the string:

The poolroom is closed

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

i) words containing both 'to' and 'do' (e.g. toydom, dogtooth, torpedo, pseudoaristocratic)

ii) a Spanish car number plate (e.g. A561PBD, C194ZJK) where the last three letters cannot contain vowels or the letter Q.

iii) Prices in , $ or " the Euro " (COULD NOT FIND THE EURO SIGN ON MY KEYPAD, SORRY!! CAN YOU KINDLY PUT IT IN FOR ME TO REPLACE " the Euro " WHEREVER YOU SEE IT THANKS, if not please just ignore the Euro bit) between 100 and 1000 (e.g. 568.45, $234.00, or " the Euro " 400)

iv) A repeated sequence of the 4 digits followed by its reverse in a longer string of digits (e.g. 6239581234432185940)

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions