Balzanka / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Reconsider regexEscaper() #1347

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This has been asked a few times internally, and we have some internal copies of 
an implementation, mainly because Pattern.quote is available but not under GWT 
(where \Q...\E doesn't work at all).

It might be nice if GWT (and other non-java.util.regex utilities, like Google's 
RE2) provided its own literal-escaping methods.

This is particularly true because escaping can differ across regex 
implementations -- e.g., whether () are metacharacters or normal characters by 
default vs. when "escaped."

I do think that we could come pretty close to a universal escaper by preferring 
[(] style escaping over \( style, but I haven't investigated in detail.

I still suspect that this isn't enough of a priority to get done, but we'll see.

Original issue reported on code.google.com by cpov...@google.com on 20 Mar 2013 at 9:20

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 20 Nov 2013 at 10:24

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:18

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08