Introducing join.
my @titles = qw/ Mr Mrs Ms Miss Dr Sir Lord Lady /; $alt_titles = join '|', @titles; if( $text =~ m/^($alt_titles)\s+(.*)/ ) { print "$1 => $2\n"; }
Dave
In reply to Re: Array within regexp?
by davido
in thread Array within regexp?
by jfrm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |