condition_from_string_match

Test the content of a string variable.

⚙️ Compatible targets: Linux, Windows

Parameters

NameDocumentation
conditionPrefix of the class (condition) generated.

This parameter is required.
valueString typed value that will be tested against the regex.

This parameter is required.
regexPattern used to test if the value against.

This parameter is required.

Example

method: condition_from_string_match
params:
  regex: VALUE
  condition: VALUE
  value: VALUE

Documentation

Test a string against a regex pattern and create conditions depending on the match result:

  • ${condition}_true condition is defined if the regex matches
  • ${condition}_false condition is defined if the regex does not match the string

The regex is singleline, case sensitive, culture invariant and implicitly enclosed by the start/end of string delimiters ^ and $. This method's reporting status will always be "success".

Examples

-name: Define is_matching_true
 method: condition_from_string_match
 params:
   condition: is_matching
   value: "Some\nmulti\nline\ntext"
   regex: "Some.*text"