T-Regx icon indicating copy to clipboard operation
T-Regx copied to clipboard

`PatternTemplate.pattern()` could accept flags

Open danon opened this issue 3 years ago • 1 comments

That way, we could build regular expressions with in-pattern flags.

Pattern::template("return @();")->pattern('strlen', 'i');

That would match

return strlen();
return strLen();
return STRLEN();

but not

RETURN strlen();

because return is being matched by the case-sensitive pattern.

danon avatar Jun 24 '22 13:06 danon

It should probably only add them if they differ, and it should ignore order.

danon avatar Aug 11 '22 21:08 danon