Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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), 6), 11).

image text in transcribedimage text in transcribedimage text in transcribed

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), 6), 11). e.g. 'ab+a' (extended regex) a) ababa b) aba c)abba dhaabbaa ejaa Answer: b,c; Pattern : The matched string should begin and end with 'a' and boccurs at least once between leading and ending 'a') Note: 1) to 5) are basic regexes: 1) 'a(ab)*a' (a)ababa (b) aaba (c) aabab (d) aabbaa (e)aa (b) a?[bc] (c) a[bc (d) a? (e) abcbc 2) a?[bc] *' (a) abc 3) '. [nd]*' (a) wind (b) window (c) end (d) good (e)will 4) ^ [a-z]+[0-9] (a) a++ (b) aa++ (c) 6+ (d) a+6 (C) aa+1 Note: 5) to 12) are extended regexes. Note: 5) to 12) are extended regexes. (c) aabab (d) aabbaa (e)aa (c) 1 (d)y (e) x++y 5) a(a/b)*a' (a)ababa (b) aaba 6) [a-z](\-[a-z0-9])+ (a)x+9 (b)x+y 7) a (bc)*z (a)azbc (b) az 8) a.*[0-9] (a)a[1 (b) *2 (c) azbcbc (d) acc (e)acz (c) ab2 (d) abc (e)aaa 9) '[a-t]+[\.\ ?!+] (a)bash! (b)c (c) Java? (d) python! (@]C++ 10) '[a-z]+[\.\ ?!]\s*[A-Z]' (hint: s matches any whitespace characters) (a)o. year (b) x?y (c) U.S. (d)Hello!HELLO (e)index?a 11) '(very\s)?(cool\s]+(good|bad) weather' (a)very weather (b) very cool weather (c) good weather (d) very cool good weather (e)cool bad weather 12) -?([0-9]|([1-9][0-9]))' (a)123 (b)-123 (C)-0 (d) -2.2 (e) 1.2 13) -?[0-9]*\.?[0-9]* (a)123 (b) -123 (c)-0 (d) -2.2 (e) 1.2

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_2

Step: 3

blur-text-image_3

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

10-4 How has e-commerce affected business-to-business transactions?

Answered: 1 week ago