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

Support for match with quoted pattern #1536

Merged
merged 2 commits into from Jul 15, 2021
Merged

Support for match with quoted pattern #1536

merged 2 commits into from Jul 15, 2021

Conversation

suarez12138
Copy link
Contributor

@suarez12138 suarez12138 commented May 11, 2021

For Pattern.quote(), it turns a regex into a raw value, which if matched directly as an argument to :match() could cause an error like the one below mentioned in #986 due to lack of deliberate escaping.

final Document doc = Jsoup.parse("<div>1) foo</div>");
System.out.println(doc.select("div:matches(" + Pattern.quote("1)") + ")"));

Therefore supports detection of the \Q and \E that Pattern.quote() generates when parsing.

@jhy jhy added this to the 1.14.2 milestone Jul 15, 2021
@jhy jhy merged commit d4f91c5 into jhy:master Jul 15, 2021
@jhy
Copy link
Owner

jhy commented Jul 15, 2021

Neato! Thanks, merged

jhy added a commit that referenced this pull request Jul 15, 2021
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.

None yet

2 participants