RosettaCodeData/Task/Regular-expressions/Scala/regular-expressions-2.scala
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

3 lines
215 B
Scala

"99 bottles of beer" matches "(\\d+) bottles of beer" // the full string must match
"99 bottles of beer" replace ("99", "98") // Single replacement
"99 bottles of beer" replaceAll ("b", "B") // Multiple replacement