Forum Discussion

grub's avatar
grub
Occasional Contributor
16 years ago

assertion > contains > regular expression

I try the assertion > contains
- content: (\d+)
- ignore case : checked or unchecked
- regular expression checked
It gives missing token in response, so the assertion failed
I just copied the 'content' from the response and changed eg. 694 into (\d+) . Also content like 694 failed .

While the assertion > contains >
- content : 694
- regular expression NOT checked
It gives assertion success .

Why is the regular expression not recognized ? I think it should be ok , according to http://www.jdocs.com/javase/7.b12/java/ ... ttern.html

I used SOAPUI beta1 and beta2 .

note: via XQUERY can be a workaround , but is a more testcode to create and maintain . Please help , the regexp assertion would be a great help .

3 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    Try modifying your expression as follows:

    (?s).(\d+).

    - the leading/trailing '.' so this can be anywhere in your message
    - the (?s) for configuring . to also match line-breaks

    Hope I got that right.. let me know!

    regards,

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    Great! Sorry about the .* typo..

    regards,

    /Ole
    eviware.com