regexp-tree icon indicating copy to clipboard operation
regexp-tree copied to clipboard

Unnecessary escape

Open fisker opened this issue 4 years ago • 1 comments

/[$@]?[a-zA-Z_\u0080-\uFFFF][\w\-\u0080-\uFFFF]*/g

Should optimize to

- /[$@]?[A-Z_a-z\u0080-\uFFFF][\w\u0080-\uFFFF\-]*/g
+ /[$@]?[A-Z_a-z\u0080-\uFFFF][\w\u0080-\uFFFF-]*/g

Found in https://github.com/prettier/prettier/pull/7991/files#diff-855523a43e898c253460fcf0f6e5f2a1R980

fisker avatar Apr 08 '20 12:04 fisker

- always sorted at last in CharacterClass , should be able to remove escape

fisker avatar Apr 08 '20 13:04 fisker