We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
we had a similar question not long ago: Using special characters in left part of a regex match?
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...
editsomething 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) In reply to Re: "Inverse" Pattern Matching
by LanX
|
|