regexp-tree
regexp-tree copied to clipboard
Regular expressions processor in JavaScript
closes #239
Hi, Regex with unicode flag and some escaped special characters can't be parsed. For example the command `regexp-tree -e '/\./u'` returns "`invalid Unicode escape \.`". And also: - `/\^/u` -...
Coming from this SO post: https://stackoverflow.com/a/36760050 The regex `^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$` got optimized (by hand) to: `^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$` so, `partbefore(\.(?!$)|$))$` can be expressed as `(partbefore\.?\b)$`, avoiding the negative look-ahead, making the regex smaller....
Hello, Is there a way to disable sub-rules of transforms, without disabling the whole transform? For example, I don't want to disable all "charEscapeUnescape", but only the sub-rule for "]"....
When using optimiser, I'm getting this weird useless optimisation: `effect` => `ef{2}ect`
Optimizes `/(\]|a|[12])/` into `/([12]a])/` which isn't correct
# Description While working with conversions between NFA's and DFA's, I noticed an issue where the starting state had changed from the corresponding NFA. # Cases - a? `{ "_nfa":...
From deepscan.io: ``` Character range 'A-z' also matches non-alphabetical characters '[', '\', ']', '^', '_' and '`'. Did you mean 'A-Za-z' instead? ``` After transforming `[a-zA-Z]`
The ES6 spec says that an expression like `\5` is a backreference "only if the integer value of DecimalEscape is
``` invalid Unicode escape \p ``` Or ```js SyntaxError: Invalid regular expression: /^[Mcen\p{}]$/: Invalid property name in character class ```