Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part II: Regular Expression 1. Chose match(es) for each given basic/extended regular expression (maybe multiple correct matches) and describe the pattern of matched string for

image text in transcribed
image text in transcribed
Part II: Regular Expression 1. Chose match(es) for each given basic/extended regular expression (maybe multiple correct matches) and describe the pattern of matched string for 3), 4), 5), 6), 11). e.g. 'ab+a' (extended regex) a) ababa baba c)abba d)aabbaa ejaa Answer: b,c; Pattern : The matched string should begin and end with 'a' and 'b'occurs at least once between leading and ending 'a') Note: 11 to 5) are basic regexes: 1) 'a[ab]*a! (a)ababa (b) aaba (c) aabab (d) aabbaa (e)aa 2) 'a(bc)? (a) abc (b) a bc)? (C) abc (d) a (e)abcbc 3) [ind] (a) wind (b) window (c) end (d) good (e)will 4) '[a-z]+[a-z]' (a) a+b+c (b) +b (C) x (d) x+1 (e) x+a Note: 5) to 12) are extended regexes. 5) '[a-z] (\-[a-z])+ (a) a+b+c (b) +b C) (d) x+1 (e) x+a 6) 'a.[bc]+ (a)azbc (b) az c) azbcbc (d) acc (e)acz 7) 'a.[0-9]' (a)azz (b) az C) a01 (d) ala (e)aza 8) "[a-z]+[\-\?!) (a)good! (b) Book. (C) hard? (d) cool?hot (e)nothing 9) "[a-z]+[\-\?!]\s* [A-Z)' (hint: \s matches any whitespace characters) (a)Grade. A (b) book. Z (C) E. G (d) Level. a (e)index?a 10) '(very )+(cool)?(good|bad) weather (a)good weather (b) very good weather (c) cool weather (d) very cool bad weather (e)cool good weather 11) -?[0-9]+ (a)3312 (b)-2231 (C) +32 (d) 0.5 (e)2/3 12) -?[0-9]*\.?[0-9]** (a)3312 (b)-2231 (C) +32 (d) 0.5 (e)2/3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions

Question

Define the communication process

Answered: 1 week ago