-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add Regex.quote #8107
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8107?orig=1 |
@qerub said: |
@som-snytt said (edited on Dec 29, 2013 8:47:47 PM UTC):
Open question how to compose quoted parts; I haven't looked at it, but it must be nicely done somewhere. E.g., {code}(a*b){code} is {code}s"(${Pattern quote "ab"})*".r{code}, is there a nicer way. |
@qerub said: |
@som-snytt said: It allows for instance: val q = "[]".r.quoted
val r = s"Array$q".r |
@adriaanm said: |
There's a
Regex.quoteReplacement
in the standard library, but noRegex.quote
. Given that quoting regex metacharacters is a common operation, I think it's a bit ugly that one has to drop down to the Java API every time.The text was updated successfully, but these errors were encountered: