You may want to take a look at perlre and perlretut. I usually pick something such as below (admittedly picked it up from Perl Best Practices by Damian Conway). I like to use the 'xms' modifiers:
my $line = qr{ \A # Start of string \s* # Leading blanks \w+ # Key \s* \w+ # Value \s* # Trailing blanks \z # End of string }xms;
Alternatively, I use Regexp::Common as well if I want to build something up from components. It's not really what you were asking, but it may be handy.
In reply to Re: how to write a multi-line regex
by rkrieger
in thread how to write a multi-line regex
by zerocred
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |