good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Perl Regexby AnomalousMonk (Archbishop) |
on Nov 17, 2019 at 06:12 UTC ( [id://11108812]=note: print w/replies, xml ) | Need Help?? |
Here's another approach: Add the /i modifier if you want case insensitive matching: my @matches = $str =~ m{ ... }xmsgi; For qr// see Regexp Quote-Like Operators in perlop. For =~ see Binding Operators in perlop. See also perlre, perlretut, and perlrequick.
Update: I often find it prudent to add an extra element of safety by using boundary assertions in data field regexes. So $rx_numeric might be better defined as (tested) Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|