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

Replace only replaces the first match #5

Open
cazzer opened this issue Apr 2, 2015 · 5 comments
Open

Replace only replaces the first match #5

cazzer opened this issue Apr 2, 2015 · 5 comments

Comments

@cazzer
Copy link

cazzer commented Apr 2, 2015

Replace does not allow us to pass in a global flag, so it will only replace the first string matched.

@evansolomon
Copy link
Contributor

sculpt.replace(/regex/g, ...) works for me

@cazzer
Copy link
Author

cazzer commented Apr 2, 2015

It does work when passing a RegExp, but not when passing a string.

@evansolomon
Copy link
Contributor

Oh, I see. The flags param in String#replace is actually not in v8 and according to MDN it's deprecated (presumably in Firefox).

@cazzer
Copy link
Author

cazzer commented Apr 2, 2015

I suppose it is more of a convenience argument, but I just sent a pull request which will build the RegExp for you if you pass a string and flag.

@cazzer
Copy link
Author

cazzer commented Apr 2, 2015

As a side note, it looks like there is an issue with you saucelabs credentials causing builds to break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants