Updated on 2023-08-07 GMT+08:00

Regular Expression

Description

When setting checkpoints or response extraction, if the expressions in the property setting bar or the character string extraction function cannot meet the requirements, you can set Advanced Extraction Type to Regular expression.

The Java regular expression engine can be used.

Example

The following response body is used as an example.

  • If the checkpoint verifies remoteUrl of the first element in the result array in the response body, obtain the IP value through regular expression matching and compare the value with the target value. The configuration is as follows. Set Type Value to ((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?).

  • If remoteUrl of the first element in the result array in the response body is extracted, obtain the IP value through regular expression matching and assign the value to the variable remoteIp. The configuration is as follows. Set Type Value to ((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?).