Created
June 15, 2015 18:35
-
-
Save rangalo/c37748e6ed048a06fc88 to your computer and use it in GitHub Desktop.
scala regex code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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