Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RegExp d flag #3086

Closed
dirkdev98 opened this issue Jun 27, 2023 · 1 comment · Fixed by #3094
Closed

Implement RegExp d flag #3086

dirkdev98 opened this issue Jun 27, 2023 · 1 comment · Fixed by #3094
Assignees
Labels
enhancement New feature or request

Comments

@dirkdev98
Copy link
Contributor

ECMASCript feature

When the d flag is present, re.exec() includes the matched indices. When the RegExp constructor is used, RegExp.prototype.hasIndices should be correctly set.

See the spec (step 6 & 34) and MDN .

Example code

/a/d.exec("a");
// [
//   'a',
//   index: 0,
//   input: 'a',
//   groups: undefined,
//   indices: [ [ 0, 1 ], groups: undefined ]
// ]

new RegExp("a", "d").hasIndices;
// true
@dirkdev98 dirkdev98 added the enhancement New feature or request label Jun 27, 2023
@dirkdev98
Copy link
Contributor Author

I'd like to work on this 😃

dirkdev98 added a commit to dirkdev98/boa that referenced this issue Jul 1, 2023
github-merge-queue bot pushed a commit that referenced this issue Jul 9, 2023
* Add regexp indices (`d` flag) support

Closes #3086

* Run rustfmt

* Fix clippy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant