Given the regular expression 3 Find all the matching pattern

Given the regular expression: \\..\\{3\\}$ Find all the matching patterns (could be more than one):

a) rs.ef$tt

b) abc.ab

c) abc.$$$$

d) abc

e) none

Solution

the answer is e) none.

the regular expression \\..\\{3\\}$ in this case didnt match with any of the test strings in the given four cases.

to be more precise the matching patterns will be checked with our regular expression as follows

\\. matches the character . literally (case sensitive)

. matches any character (except for line terminators)

\\{ matches the character { literally (case sensitive)

3 matches the character 3 literally (case sensitive)

\\} matches the character } literally (case sensitive)

$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)

in this there is no matching pattern and hence the answer is none

Given the regular expression: \\..\\{3\\}$ Find all the matching patterns (could be more than one): a) rs.ef$tt b) abc.ab c) abc.$$$$ d) abc e) noneSolutionthe

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site