Whether this is any less ugly you'll have to make your own mind up about.
use constant FRED=>'fred'; my @s = qw[ the=the quick=quick brown=brown fred=fred1 jumped=jumped over=over the=the lazy=lazy fred=fred2 ]; $_ =~ ( FRED . '=(.*)$' ) and print "Found $1" for @s; Found fred1 Found fred2
In reply to Re: matching constants within a regular expression?
by BrowserUk
in thread matching constants within a regular expression?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |