Skip to content

Instantly share code, notes, and snippets.

@rangalo
Created June 15, 2015 18:35
Show Gist options
  • Save rangalo/c37748e6ed048a06fc88 to your computer and use it in GitHub Desktop.
Save rangalo/c37748e6ed048a06fc88 to your computer and use it in GitHub Desktop.
scala regex code
import scala.util.matching.Regex
object HelloWorld {
def main(args: Array[String]) {
val pattern = new Regex("Id=(.*)")
val str = "http://www.xyz.com?Id=798"
val res = pattern.findAllMatchIn(str)
res.foreach { m =>
println("Grp=" + m.group(1))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment