fent / fent/ret.js

Lazy quantifiers does not considered

Open
#41 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
JavaScript
Stars
98
Forks
21
PR merge metrics
No merged PRs in 30d

Description

```
const ret = require('ret');

let tokens = ret(^\/store\/(?:([^\/]+?)));
```

Question mark after the plus in the regex is a [lazy quantifier](https://www.regular-expressions.info/repeat.html#lazy) but it is considered as optional identifier, and in the result:

`{
"type": 0,
"stack": [
{
....
{
"type": 1,
"stack": [
{
"type": 1,
"stack": [
{
"type": 5,
"min": 0 #this mean that it is optional,
"max": 1,
"value": {
...
}
}
}
]
...
}
]
}`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.