Page 1 of 1

help with Match all except specific pattern

Posted: Wed Sep 09, 2015 3:54 am
by zintonio
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

Re: help with Match all except specific pattern

Posted: Wed Sep 09, 2015 9:59 am
by Christopher
You could try negative lookahead, something like: "/(?! [0-9]*\)))/"