in reply to Re: Re: regex that simulates boolean logic
in thread regex that simulates boolean logic
Thanks for the reply, BrowserUk.. yes, it fixes the cases that didnt work before.. (it was failing on 70000, 77000 and on 207000), those passed.. I'll collect as many more cases as I can from the logfile and throw them at my test script during the course of the day..
in the interests of learning a bit more about how this works, could you please check if my decoding of the regex is correct.. ?
What you're doing is anchoring to the start of a line (^), then you got the negation (?!), then you're doing OR based matches, with one crucial difference from what I was doing, you're anchoring EACH of the matches to the end of line char ($).. and then finally 1 or more digit chars are a positive match (\d+$)..
Compared to my effort,
I didn't need the 0-9+, I could have simply used \d+ instead, I didnt need a .* before matching the trailing digits.. but err, one question, how does this work without a \d+ or a .* match in front ?/^(?!.*7000|7777|7778|3886200|2200|8488|3406|9100|29389988|7688|5000|2 +0|3408|3404|7648).*[0-9]+/)
Oh, and one more question, please.. where do I learn more about all this ? I have a browser window opened to the perlre manpage, and another to the CD bookshelf, are there any other references on this sort of thing ? (I have a copy of Jeffery Friedls regex book, but it sorta whizzed over my head) :(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: regex that simulates boolean logic
by BrowserUk (Patriarch) on Nov 28, 2002 at 04:12 UTC |