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
Post a Comment