Skip to content

Instantly share code, notes, and snippets.

@Derekokich
Created August 18, 2014 21:01
Show Gist options
  • Save Derekokich/58ce66fe7a27419ff4a9 to your computer and use it in GitHub Desktop.
Save Derekokich/58ce66fe7a27419ff4a9 to your computer and use it in GitHub Desktop.
regexblog8
def listToConcat(list: List[RegexExpr]): RegexExpr = list match {
case head :: Nil => head
case head :: rest => Concat(head, listToConcat(rest))
}
def apply(input: String): Option[RegexExpr] = {
parseAll(highExpr, input) match {
case Success(result, _) => Some(result)
case failure : NoSuccess => None
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment