condition_from_string_match
Test the content of a string variable.
⚙️ Compatible targets: Linux, Windows
Parameters
Name | Documentation |
---|---|
condition | Prefix of the class (condition) generated. This parameter is required. |
value | String typed value that will be tested against the regex. This parameter is required. |
regex | Pattern used to test if the value against. This parameter is required. |
Outcome conditions
You need to replace ${condition}
with its actual canonified value.
- ✅ Ok:
condition_from_string_match_${condition}_ok
- ☑️ Already compliant:
condition_from_string_match_${condition}_kept
- 🟨 Repaired:
condition_from_string_match_${condition}_repaired
- ☑️ Already compliant:
- ❌ Error:
condition_from_string_match_${condition}_error
Example
method: condition_from_string_match
params:
value: VALUE
regex: VALUE
condition: 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"