in reply to "Inverse" Pattern Matching
In short: It's not easy!!!
I'm not sure how efficient it is but I might try to code all possibilities into a long or-clause
/(12345x|1234x6|123x56|123x6| ...)/
please note that from 5.10 on such expressions are efficiently trie-optimized.
Another approach could be to match all "x" and surrounding n bytes to be further investigated...
something like /(1 [2-5]{0,4} x [2-5]{0,4} 6)/gx in a while loop to narrow the set of possible matches.
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "Inverse" Pattern Matching
by hdb (Monsignor) on Jul 05, 2013 at 12:22 UTC |