They represent /x , /i , /s , /m if the letter appears to the left of - and the absence of a modifier if the letter appears to the right of - .
The purpose of the code is used to transmit the specified flags.
>perl -E"$re = qr/./s; say qq{a\nb} =~ /a${re}b/ ? 'match' : 'no match'" match >perl -E"$pat = '.'; say qq{a\nb} =~ /a${pat}b/ ? 'match' : 'no match'" no match >perl -E"$pat = '(?s-xim:.)'; say qq{a\nb} =~ /a${pat}b/ ? 'match' : 'no match'" match
... and which were not.
>perl -E"$re = qr/./; say qq{a\nb} =~ /a${re}b/s ? 'match' : 'no match'" no match >perl -E"$pat = '.'; say qq{a\nb} =~ /a${pat}b/s ? 'match' : 'no match'" match >perl -E"$pat = '(?-xism:.)'; say qq{a\nb} =~ /a${pat}b/s ? 'match' : 'no match'" no match
(?:...) documented in perlre .
ikegami
source share