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
In reply to Re: string problem
by johngg
in thread string problem
by nicholaspr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |