-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
What’s the point of (?!\*)
?
#853
Comments
HI, |
But how that regex differs from one without /\blang(?:uage)?-(?!\*)(\w+)\b/i.test('lang-*php'); // returns `false`
/\blang(?:uage)?-(\w+)\b/i.test('lang-*php'); // returns `false` too! |
Ho, indeed, \w exclude *, you're right it's redundant. What's the line and file? With them we could know who wrote this and ask him/her if there is a reason. |
It’s here: /components/prism-core.js:18 Added in cfaf681 |
Yeah, I have no idea why I added that, since as you pointed out, |
Thanks! |
I’m trying to understand the Prism source code. What’s the point of
(?!\*)
in the following line:I know it’s a negative lookahead. In this regex it means that an asterisk doesn’t follow the hyphen.
But where is it needed?
The text was updated successfully, but these errors were encountered: