IRegexpChecker is pushdown automaton that very quickly determines if a regular expression using a specified interoperable subset is syntactically correct.
It supports the I-Regexp specification.
npm install && npx jest --coverage
import iregexp from '@springcomp/iregexp';
const regex = second as string;
try{
iregexp.ensureExpression(regex);
}
catch (err) {
...
}
This currently fails to check the following expressions as invalid:
[z-a]
: reversed range.a{9,3}
:reversed min/max quantities.