🐛 (conditions) Fix regex matching when starting and ending wi…
Closes #1393
This commit is contained in:
@@ -126,6 +126,7 @@ const executeComparison =
|
|||||||
case ComparisonOperators.MATCHES_REGEX: {
|
case ComparisonOperators.MATCHES_REGEX: {
|
||||||
const matchesRegex = (a: string | null, b: string | null) => {
|
const matchesRegex = (a: string | null, b: string | null) => {
|
||||||
if (b === '' || !b || !a) return false
|
if (b === '' || !b || !a) return false
|
||||||
|
if (b.startsWith('/') && b.endsWith('/')) b = b.slice(1, -1)
|
||||||
return new RegExp(b).test(a)
|
return new RegExp(b).test(a)
|
||||||
}
|
}
|
||||||
return compare(matchesRegex, inputValue, value, 'some')
|
return compare(matchesRegex, inputValue, value, 'some')
|
||||||
|
|||||||
Reference in New Issue
Block a user