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

Allowing regex to match only first #23

Closed
ZSkycat opened this issue Jul 6, 2018 · 2 comments
Closed

Allowing regex to match only first #23

ZSkycat opened this issue Jul 6, 2018 · 2 comments

Comments

@ZSkycat
Copy link
Contributor

ZSkycat commented Jul 6, 2018

When I only need to find the first one, I don't need g flag.

scenes to be used: https://github.com/ZSkycat/ghost-progress-webpack-plugin/blob/master/src/helper.ts#L80

ZSkycat added a commit to ZSkycat/ansi-regex that referenced this issue Jul 6, 2018
@sindresorhus
Copy link
Member

Sounds like a valid use-case. I don't think it should accept regex flags though, but rather an option called onlyFirst to match only the first item.

@ZSkycat
Copy link
Contributor Author

ZSkycat commented Jul 6, 2018

Agree, I will modify my commit

@ZSkycat ZSkycat changed the title Allowing regex patterns to specify flags Allowing regex to match only first Jul 6, 2018
ZSkycat pushed a commit to ZSkycat/ansi-regex that referenced this issue Jul 6, 2018
ZSkycat added a commit to ZSkycat/ansi-regex that referenced this issue Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants