Created
March 17, 2012 13:30
-
-
Save notyy/2059033 to your computer and use it in GitHub Desktop.
too easy
This file contains hidden or 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
scala> s | |
res12: java.lang.String = | |
{ | |
"ret":0, | |
"msg":"", | |
"nickname":"Peter", | |
"figureurl":"http://exmple.qq.com/qzapp/000000000000000000000000000F4262/50", | |
"gender":"??" | |
} | |
scala> val UserInfoRegex = """(.*)"nickname":"(.*)","figureurl":"(.*)",(.*)""".r | |
UserInfoRegex: scala.util.matching.Regex = (.*)"nickname":"(.*)","figureurl":"(.*)",(.*) | |
scala> val UserInfoRegex(_,nickName,figureUrl,_) = s.lines.mkString("") | |
nickName: String = Peter | |
figureUrl: String = http://exmple.qq.com/qzapp/000000000000000000000000000F4262/50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment