Regular expression in contains assertion
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2008
02:39 AM
05-09-2008
02:39 AM
Regular expression in contains assertion
Hi,
I'm having some trouble using a regular expression for a 'Contains' assertion (SoapUI Pro 2.0.2). No matter what I specify for the regular expression, it never matches and the assertion fails. Even '.*' does not match, which suggests a bug I think.
I'm having some trouble using a regular expression for a 'Contains' assertion (SoapUI Pro 2.0.2). No matter what I specify for the regular expression, it never matches and the assertion fails. Even '.*' does not match, which suggests a bug I think.
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2008
05:57 AM
05-09-2008
05:57 AM
Hi Jozef
thanks for your post! By defaul, the "." sign does not match line-breaks, so unless your response is just one long line, the ".*" wont work. You should prefix the expression with "(?s)", which tells the regex processor to include line-breaks (see http://www.jdocs.com/javase/7.b12/java/ ... ttern.html for more info on this).. so if you enter
(?s).*
you should get a match for anything..
hope this helps!
regards,
/Ole
eviware.com
thanks for your post! By defaul, the "." sign does not match line-breaks, so unless your response is just one long line, the ".*" wont work. You should prefix the expression with "(?s)", which tells the regex processor to include line-breaks (see http://www.jdocs.com/javase/7.b12/java/ ... ttern.html for more info on this).. so if you enter
(?s).*
you should get a match for anything..
hope this helps!
regards,
/Ole
eviware.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2008
08:06 AM
05-09-2008
08:06 AM
Thanks for the quick reply. I took a look at the pattern syntax on the page you mentioned but missed the (?s) expression. Maybe a small example in the SoapUI documentation on Contains assertions would be nice, even if it is just (?s).*
It would've saved me some time
It would've saved me some time

- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2008
04:57 AM
05-12-2008
04:57 AM
Hi Jozef,
ok, we'll do that 🙂
regards,
/Ole
eviware.com
ok, we'll do that 🙂
regards,
/Ole
eviware.com
