Given the regular expression Find all the matching patterns

Given the regular expression: ^[^\\$]*$ Find all the matching patterns (could be more than one):

a) $$$$$$aaaaaa

b) bcdef$

c) $

d) abc

e) none

Solution

answer is : b and c

\\$ -->supress the special meaning of $ and take it normally

^\\$ -->not $

^[^\\$] *-->indicate pattern which contains one or more $ symbols

^[^\\$] *$ -->which sayst the pattern ends with one or more $ symbols

in our example bcdef$ pattern ends with single $

and $ is also ends with $

Given the regular expression: ^[^\\$]*$ Find all the matching patterns (could be more than one): a) $$$$$$aaaaaa b) bcdef$ c) $ d) abc e) noneSolutionanswer is

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site