String extract Test Object (string-extract)

String extract Test Object (string-extract)

Action to do extract method on strings with regex.

Release in: 3.0.1

Usage:

<string name=""! value=""! regex=""!/>

! - mandatory

About regex: Regular expression .

Example

Example

Behaviour

Example

Behaviour

<string-extract name="testString" regex="(John) (.+?) " value="John writes about this, and John Doe writes about that, and John Wayne writes about everything."/>

Using extract method, we can extract the substring by passing a regex pattern. 'testString' will be 'John writes'

<string-extract name="testStringNull" regex="invalid " value="testStringExtract"/>

Using extract method, by passing an inavalid regex pattern. 

'testString' will be null.







Related content