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

Selector find(':not(:contains("any"))') not work #159

Open
lokanaft opened this issue Feb 8, 2021 · 2 comments
Open

Selector find(':not(:contains("any"))') not work #159

lokanaft opened this issue Feb 8, 2021 · 2 comments

Comments

@lokanaft
Copy link

lokanaft commented Feb 8, 2021

Any combinations with "not contains" not work with error:

Fatal error: Uncaught DiDom\Exceptions\InvalidSelectorException: Invalid selector "("any""

I think query parser not understand so combinations

@Imangazaliev
Copy link
Owner

The problem is that the selector regular expression can't handle nested brackets correctly:

/(?P<tag>[\*|\w|\-]+)?(?:#(?P<id>[\w|\-]+))?(?P<classes>\.[\w|\-|\.]+)*(?P<attrs>(?:\[.+?\])*)?(?::(?P<pseudo>[\w\-]+)(?:\((?P<expr>[^\)]+)\))?)?\s*(?P<rel>>)?/is

mathes the following:

image

@Imangazaliev
Copy link
Owner

Imangazaliev commented Feb 9, 2021

Fixed in 1.6.4.

UPD: not fixed: 2465282#commitcomment-46942406.

Canceled the release.

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