- or download this
sub iregex { qr/ ... /ix }
...
if ($isbn =~ $regex ) { print "Matched!\n }
3) if ($isbn =~ iregex() ) { print "Matched!\n }
- or download this
> perl -we'use strict;use P;
my $re = qr{ (\w+) }gx;
...
Bareword found where operator expected at -e line 2, near "qr/ (\w+) /
+gx"
syntax error at -e line 2, near "qr{ (\w+) }gx"
Execution of -e aborted due to compilation errors.
- or download this
> perl -we'use strict;use P;
my $re = qr{ (\w+) }x;
...
exit scalar(@matches);'
output:
#matches=4, matches=["Just", "another", "cats", "meow"]
- or download this
perl -we'use strict;use P;
my $re = qr{ (?xg) (\w+) };
...
output:
Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/ (?xg
+ <-- HERE ) (\w+) / at -e line 2.
#matches=1, matches=["another"]