Scala regex youtube video id -


i trying extract video id youtube url using following:

val youtuberegex = """v=([^&]+)""".r    "v=iqj13vfyou8&feature=g-all-lik" match {     case youtuberegex(videoid) => videoid     case _ => throw new nosuchfielderror("impossible find youtube id")   } 

saddly not work ... ideas ? lot

isn't supposed that?

val youtuberegex = """v=([^&]+).*""".r // need specify there remainder  "v=iqj13vfyou8&feature=g-all-lik" match {   case youtuberegex(videoid) => videoid   case _ => throw new nosuchfielderror("impossible find youtube id") } 

so iqj13vfyou8 part without options.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -