Hi all, i have some problem matching everything except a specific pattern. I post an example:
My string is:
test 1) test2 3) test3 22) test5 34)
What i need to select is everithing except 1) 3) 22) 34)
I used this (?!\d+\)). but this pattern match only the numbers. I mean the result is : test ) test2 ) test3 ) test5 )
Instead I would like to have this: test test2 test3 test5
How can I do to do that?
Thanks in advance
help with Match all except specific pattern
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13592
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: help with Match all except specific pattern
You could try negative lookahead, something like: "/(?! [0-9]*\)))/"
(#10850)