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

The `asNodes` isn't used internally, and but still is handled in the traverse module. It's not that much one can do traversing just the nodes, and we should encourage usage...

These should match: ```js const {fa} = require('regexp-tree'); fa.prefixMatch(/ab/, 'a'); // true fa.prefixMatch(/ab/, 'ab'); // true fa.prefixMatch(/ab/, ''); // true ```

Currently NFA/DFA matcher tests for the entire string, as it would be treated as `^ ... $`. E.g., this matches: ```js fa.toDFA(/a/).matches('a'); // true ``` But this doesn't: ```js fa.toDFA(/a/).matches('ab');...

NFA/DFA interpreter supports basic building blocks, such as Kleene-closure: `a*`. We should transform several constructs which are syntactic sugar to their basic representation, so the interpreter can handle them: -...

As per ECMAScript spec, `\s` matches any WhiteSpace or LineTerminator character: ![1248bc49-5e3a-45b7-aa45-8426aa28fd0a](https://user-images.githubusercontent.com/557590/27735672-bfa8e6b8-5d98-11e7-8352-cadcaa7ab926.png) Currently optimizer docs say it transforms `[ \t\r\n\f]` to `\s` (and the opposite), but this changes runtime semantics...

All the other character types allow to match exactly a single character (as the node type `Character` suggests), but `\w`, `\d`, ... are mixed with single-char escapes under `meta` kind....

While source maps are not extremely useful for debugging on such a small data sets, they can be still handy for testing transformers and (re)using existing tools that can match...

Right now various productions such as `/(?:)/`, `/1|/`, etc. can produce `null` values in place of sub-expressions when parsed. It could be useful (as in just "nice") to have instead...

``` /\75/ ``` Should parse into: ```json { "type": "Char", "value": "\\75", "kind": "oct", "symbol": "=", } ``` And not to: ```json { "type": "Char", "value": "\\75", "kind": "decimal", "symbol":...

We can use something like [railroad-diagrams](https://github.com/tabatkins/railroad-diagrams) to generate an `.html` file with the diagram, drawn for a regexp. ```js ./bin/regexp-tree -e '/[0-9]+/' --diagram ``` (we can consider other diagram frameworks,...