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

Regular Expr question


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


I would see line with this pattner

UpdateStatus: [spOne]
UpdateStatus: [spTwo]

and I would not to see line with this pattern

UpdateStatus: [spUnknown]

how can do ?

Ing Giuseppe Monteleone


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.


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.