0
Need help with $ in paterm
why only pattern 3 and 4 matches https://code.sololearn.com/ckOirMHWK8Z0/?ref=app https://code.sololearn.com/ckOirMHWK8Z0/?ref=app
2 Réponses
+ 2
pattern1 and pattern2 will only match strings ending with an 'e' since the $ is not escaped.
pattern3 matches string1 since the escaped $ matches a literal '#x27;
pattern4 matches string2 because the escaped \ followed by an escaped $ matches the literal '\#x27;
+ 1
that makes sense now. thanks.