Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Regular Expr question


#1

I Try the following regular expression but it doesn’t work…

UpdateStatus.*[(?!(spUnknown))]

I would see line with this pattner

UpdateStatus: [spOne]
UpdateStatus: [spTwo]
ecc.

and I would not to see line with this pattern

UpdateStatus: [spUnknown]

how can do ?

Thanks
Ing Giuseppe Monteleone


#2

Hello Giuseppe,

Negating expressions is always a bit tricky. I will take a look at your particular expression and will get back to you tomorrow.


#3

The following works:

It seems it’s a bit difficult to find a regex that negates some subexpression that is not contained at the end or the beginning of the expression but somewhere in between. If you omit the closing bracket, it works fine.