Skip to content

Commit

Permalink
Merge pull request #194 from mP1/feature/SpreadsheetExpressionFunctio…
Browse files Browse the repository at this point in the history
…nBooleanTextMatch-calls-TextMatch

SpreadsheetExpressionFunctionBooleanTextMatch calls TextMatch
  • Loading branch information
mP1 authored Nov 12, 2024
2 parents 8ec9131 + 57fbb70 commit 67de421
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

package walkingkooka.spreadsheet.expression.function;

import walkingkooka.predicate.Predicates;
import walkingkooka.spreadsheet.expression.SpreadsheetExpressionEvaluationContext;
import walkingkooka.text.CaseSensitivity;
import walkingkooka.tree.expression.function.ExpressionFunctionParameter;
import walkingkooka.tree.expression.function.ExpressionFunctionParameterKind;
import walkingkooka.tree.expression.function.ExpressionFunctionParameterName;
Expand All @@ -47,13 +45,11 @@ public Boolean apply(final List<Object> parameters,
final SpreadsheetExpressionEvaluationContext context) {
this.checkParameterCount(parameters);

final String pattern = PATTERN.getOrFail(parameters, 0);
final String text = VALUE.getOrFail(parameters, 1);

return Predicates.globPatterns(
pattern,
CaseSensitivity.INSENSITIVE
).test(text);
return TextMatch.parse(
PATTERN.getOrFail(parameters, 0)
).test(
VALUE.getOrFail(parameters, 1)
);
}

final static ExpressionFunctionParameter<String> PATTERN = ExpressionFunctionParameterName.with("pattern")
Expand Down

0 comments on commit 67de421

Please sign in to comment.