perl - Regex pattern concatenation -
is possible somehow concatenate this:
my $ pattern1 = qr/^/; with this:
my $ pattern2 = qr/abc/ so (the value of) this?
qr/^abc/ the syntax different, want achieve result.
you can concatenate regular expressions easily:
say /$pattern1$pattern2/ 'abc', 'xabc'; to increase readability, can use /x modifier , add space:
say / $pattern1 $pattern2 /x qw( abc xabc ); note scalars written without space after $ sigil.
Comments
Post a Comment