in reply to Re: Regex Subexpressions
in thread Regex Subexpressions
For this example, I expect to get these results:@keywordList = ('john', 'john.smith', 'john.smith@mail.com'); $combinedExpression = combine(@keywordList); # The combined expression looks something like this: # (john(?:\.smith(?:\@mail\.com)?)?) $searchText = "john's username is john.smith and his email address is +john.smith@mail.com"; while $searchText =~ /$combinedExpression/g { print "$1\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex Subexpressions
by grinder (Bishop) on Sep 10, 2005 at 08:35 UTC |