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

Regular expressions processor in JavaScript

Results 47 regexp-tree issues
Sort by recently updated
recently updated
newest added

I use `regexp-tree` via [eslint-plugin-unicorn/better-regex](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/better-regex.md) and found that some optimizations lead to less-readable output. Similarly to #135, I'd argue that readability and shortness might not always overlap. I found this...

```js /[$@]?[a-zA-Z_\u0080-\uFFFF][\w\-\u0080-\uFFFF]*/g ``` Should optimize to ```diff - /[$@]?[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

(My "issue" is documentation correction, and request for documentation clarification.) The README, under lookbehind assertions is out of date: >NOTE: Lookbehind assertions are not yet supported by JavaScript RegExp. It...

Hi, While I expect this might not be trivial given that the sorting presumably helps in building ranges, it would be very useful if this resorting could be optionally disabled....

Currently we support only JavaScript regexes. However, _regexp-tree_ can be _language-agnostic_, and support any other formats/modes/syntaxes of regular expressions. Thus, `transform`, and `traverse` modules can be fully reused for any...

Example: ```js /\p{ASCII_Hex_Digit}/u ``` Compiles to: ```js /[0-9A-Fa-f]/ ``` See example in https://mothereff.in/regexpu (@mathiasbynens)

The current comment grammar eats up the slash and flags after a comment when using the `x` flag: ~~~~ const re = `/ # A regular expression for date. (?\d{4})-...

Hello, Adding the meta specialCharacter '.' in a CharacterClass shouldn't lead to an error? Generate a regexp from ``` {"body": {"type":"CharacterClass", "expressions": [{"type":"Char","value":".","kind":"meta"}]}, "flags":"gm","type":"RegExp"} ``` has this result `/[.]/gm` Best...

In addition to the educational [finite-automata](https://github.com/DmitrySoshnikov/regexp-tree/tree/master/src/interpreter/finite-automaton) evaluator, we should implement the [regexp patterns semantics](https://tc39.github.io/ecma262/#sec-pattern-semantics) from the ECMAScript spec. Ideally this should be as close to the spec as possible, however...

This is more of a question than an issue. Is the Optimizer more an optimizer or a minifier? Or both at the same time? Currently, the Optimizer does some "optimizations"...