Add s and u flag support for regex (#1397)

* add s flag support for regex

* add u flag (its supported since nodejs 6.4.0)
This commit is contained in:
lublak
2021-02-05 09:29:16 +01:00
committed by GitHub
parent 10ddcebf21
commit 0398ec7348
3 changed files with 3 additions and 3 deletions

View File

@@ -270,7 +270,7 @@ export class If implements INodeType {
startsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => (value1 as string).startsWith(value2 as string),
isEmpty: (value1: NodeParameterValue) => [undefined, null, ''].includes(value1 as string),
regex: (value1: NodeParameterValue, value2: NodeParameterValue) => {
const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimy]*)$'));
const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$'));
let regex: RegExp;
if (!regexMatch) {