DmitrySoshnikov / regexp-tree

Regular expressions processor in JavaScript
MIT License
401 stars 43 forks source link

[group-single-chars-to-char-class] corrupts regexp when using square bracket #255

Open Maxim-Mazurok opened 1 year ago

Maxim-Mazurok commented 1 year ago

Optimizes /(\]|a|[12])/ into /([12]a])/ which isn't correct

DmitrySoshnikov commented 1 year ago

Thanks, we might need to exclude the ] at all from this transform. Will appreciate a PR.