Skip to content

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.

2 participants