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 Given the regular expression: ^[^\\$]*$ Find all the matching patterns (could be more than one): a) $$$$$$aaaaaa b) bcdef$ c) $ d) abc e) noneSolutionanswer is](/WebImages/16/given-the-regular-expression-find-all-the-matching-patterns-1026515-1761531540-0.webp)