Skip to content

Conversation

tmadeira
Copy link
Contributor

Avoid crashing Safari and other browsers which do not support lookbehind in JS regular expressions (https://caniuse.com/js-regexp-lookbehind), fixes #106.

Copy link
Owner

@scriptcoded scriptcoded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I don't have access to Safari I see this is an issue and am kind of ashamed I hadn't thought about it 🙈

The tests pass and checking for a word boundary should work pretty much exactly the same. Just a note for the sake of documenting, technically a word character is not the same as what's currently being matched, but in this case I don't think it matters. And it solves the issue.

Thanks for the PR!

@scriptcoded scriptcoded merged commit 8e52120 into scriptcoded:master Mar 16, 2023
@scriptcoded
Copy link
Owner

I'll release this later tonight unless anything else pops up here as I don't follow a set release schedule.

@tmadeira
Copy link
Contributor Author

@scriptcoded Thank you!

@tmadeira tmadeira deleted the safari branch March 16, 2023 17:45
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

Successfully merging this pull request may close these issues.

Lookbehind in number regexp crashes Safari
2 participants