2
0

🐛 (conditions) Fix regex matching when starting and ending wi…

Closes #1393
This commit is contained in:
Baptiste Arnaud
2024-03-29 07:58:46 +01:00
parent 1566f010f7
commit 76e7fbd1c7

View File

@ -126,6 +126,7 @@ const executeComparison =
case ComparisonOperators.MATCHES_REGEX: {
const matchesRegex = (a: string | null, b: string | null) => {
if (b === '' || !b || !a) return false
if (b.startsWith('/') && b.endsWith('/')) b = b.slice(1, -1)
return new RegExp(b).test(a)
}
return compare(matchesRegex, inputValue, value, 'some')