in reply to Perl Regex Match (Compare Only AlphaNumeric)
$out = $1 if ($data_main =~ /(NewStoreOpeningPromenadeinCrockerParkRackNordstromRackisadivisionofNordstrom.*)/is);
There is no "ignore non-alphanumeric characters when matching" regex modifier available in the standard Perl regex engine. (It's apparently possible to create and use your own regex engine in later versions of Perl 5 and in Perl 6, but I've never done or even attempted anything like this.) You must either take whitespace, etc., characters into account when matching, or else remove all such characters before comparing, matching, etc., both of which approaches have been suggested or exemplified by others. Please see perlre, perlretut, perlrequick.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Regex Match (Compare Only AlphaNumeric)
by Anonymous Monk on Aug 23, 2013 at 12:10 UTC |