in reply to Re: Parsing with perl - Regexes and beyond
in thread RFC: Parsing with perl - Regexes and beyond
I tried running this code. Sometimes it worked and sometimes it failed.
Unusual for perl...
Then I remembered that recently hashes were randomized = bingo!
The line
my $reOps = qr[@{[ join '|', map{ quotemeta } keys %ops ]}];
needs to be changed to
my $reOps = qr[@{[ join '|', map{ quotemeta } sort { length $b <=> length $a } keys %ops ]}];
to keep * from being matched before **
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Parsing with perl - Regexes and beyond
by BrowserUk (Patriarch) on Sep 20, 2016 at 23:30 UTC | |
Re^3: Parsing with perl - Regexes and beyond
by Discipulus (Canon) on Sep 22, 2016 at 08:09 UTC | |
by tybalt89 (Monsignor) on Sep 22, 2016 at 12:05 UTC | |
Re^3: Parsing with perl - Regexes and beyond
by BrowserUk (Patriarch) on Sep 20, 2016 at 22:56 UTC |
In Section
Meditations