Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part II: Regular Expression 1. Chose match(es) for each given basic/extended reg

ID: 3747910 • Letter: P

Question

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). 6). 11). e.g. abea (extended regex) Answer: bc; Pattern:The matched string should begin and end with a and b'occurs at least once between leading and ending a 1) a(ab)-a (a)ababa (b) aaba (c) aabab (d) aabbaa (e)aa abc (b)abc c d) a? e)abcbc 3) Ind (a) wind ( indow (c) end d) good (e)will 4) Ta-z] 10-9 34+ (b) aat+(c)6+ d) a+6 (e)aa 1 5) a(alb)'a (ajababa (b) aaba (c) aabab (d) aabbaa (e)aa (b) x+y (c) 1 (b) az (azbcbc (d) acc (elacz (b) a2 ()ab (d) abc (e)aaa 6) Ta-z a-z0-9])+ (a) x+9 (d)y (e)x*y 7) a (bc)z (ajazbe 8) a [0-9) (a)al1 (a)bash! (b)c (c) Java? (d) python! e) 10) Ta-z]N1?s IA-Z (hint: Is matches any whitespace characters) (a)o. year (b)xy (c)US. (d)Hello!HELLo (e)index?a 11) (veryls)?(cools) (goodbad) weather (a)very weather b) very cool weather (c) good weather

Explanation / Answer

1. b) aaba, e)aa

Pattern: The matched string should begin and end with 'a' with repeating sequence of 'ab' in middle.

2. a) abc, e) abcbc

Pattern: The matched string should begin with zero or more a's followed by sequence of b's or c's.

3. c) end

Pattern: The matched string should begin with any character followed by sequence of n's or d's.

4. d) a+6

Pattern: The matched string should begin with any alphabet followed by '+' and then followed by a digit.

NOTE: As per Chegg policy, I am allowed to answer only 4 questions on a single post. Kindly post the remaining questions separately and I will try to answer it. Sorry for the inconvenience caused.