in reply to string problem
Because the plus sign is a regular expression metacharacter and must be escaped.
$ perl -E ' > $str = q{DSI+DSI+}; > say q{Yes} if $str =~ m{(DSI\+DSI)}; > say qq{Matched $1, length @{ [ length $1 ] }};' Yes Matched DSI+DSI, length 7
I hope this is helpful.
Cheers,
JohnGG
|
|---|