$ 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