#!/usr/bin/perl use strict; use warnings; use re qw(debugcolor); my $names = 'Fred Flintstone and Wilma Flintstone'; if ($names =~ m/(?<last_name>\w+) and \w+ \g{last_name}/) { print "I saw $+{last_name}\n"; }
In reply to Re: regex and matching
by Khen1950fx
in thread regex and matching
by hasnainzeenwala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |