Open scabug opened 16 years ago
Imported From: https://issues.scala-lang.org/browse/SI-1482?orig=1 Reporter: Mohamed Bana (mbana)
@dcsobral said: Can you provide at least a proposal of what you'd like it to look like?
simao mata (simao) said: +1 on this one.
One option would be a new parser method, analogous to the literal
method in , caseInsensitiveLiteral
, for example, that would match strings without comparing case.
Thanks
Ilan Biala (ilanbiala) said (edited on Jul 3, 2014 4:09:12 PM UTC): Couldn't the code for a new regex be changed to something like this
new Regex(string, flags)
where string = Regular expression as a string flags = string of all the flags, i.e. "im" or "mi" for multiline input and case-insensitive
This is how some other languages and libraries do it and not only is it cleaner, but .findAllIn could also be removed in favor of /abc/g for greedy regexes.
Hi,
The
scala.util.parsing.combinator
library should provide a way of turning on case insensitive matches; having to prefix every string with a (?i) isn't ideal. E.g.,"""(?iu)\|H""".r
, just ends up cluttering up the code.