Forum Discussion

cdunne's avatar
cdunne
Contributor
17 years ago

Using Reg Expressions in Xpath assertion

Hi,

Is it possible to supply a regular expression as the value to validate against in the xpath assertion rather than a wildcard character?

Cheers

Cormac
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Cormac,

    you can use the regex support in xpath 2.0 for this; if you want the text of a certain element to match a certain regex, specify the following:

    matches( //somelement/text(), '.*' )

    and set the expected value to true or false (whichever you want)

    The matches function available in soapUI is documented at

    http://www.saxonica.com/documentation/f ... tches.html

    Hope this helps!

    regards,

    /Ole
    eviware.com