RED-3666: Added rule function Section containsRegEx

This commit is contained in:
deiflaender 2022-04-11 12:50:30 +02:00
parent efd53066c4
commit 404fd25be0

View File

@ -240,6 +240,17 @@ public class Section {
}
@WhenCondition
public boolean containsRegEx(@Argument(ArgumentType.STRING) String regEx, @Argument(ArgumentType.BOOLEAN) boolean patternCaseInsensitive){
var compiledPattern = Patterns.getCompiledPattern(regEx, patternCaseInsensitive);
var matcher = compiledPattern.matcher(text);
return matcher.find();
}
@WhenCondition
public boolean rowEquals(@Argument(ArgumentType.STRING) String headerName, @Argument(ArgumentType.STRING) String value) {