Skip to content

Lack of essential detail about regexp lookbehind syntax in "Lookahead and lookbehind" article #3297

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

Open
rafayel23 opened this issue Dec 9, 2022 · 2 comments

Comments

@rafayel23
Copy link

Part 3 (Additional articles)
Chapter 7 (Regular expressions)
Article 14 (Lookahead and lookbehind)

Why you don't mention that in JS non fixed length regexps (including quantifiers, backreferences etc.) are not allowed inside lookbehind expression ?

First you talk about lookahead, and using regexp with quantifier as lookahead condition in your example.

Copied from www.javascript.info
For example, \d+(?=\s)(?=.*30) looks for \d+ that is followed by a space (?=\s), and there’s 30 somewhere after it (?=.\*30)

Right after this you briefly talk about lookbehind and say it is the same thing but looks behind, without mentioning that it actually cannot do the same thing with non fixed lenght regular expressions (including quantifiers like *).

@vsemozhetbyt
Copy link
Contributor

As far as I know, JS does supports non fixed length regular expressions in lookbehind:
re

@joaquinelio
Copy link
Member

Isn't it a browser support issue?

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

3 participants