Find matches in a string:
Find matches in a string:
val location: Regex = Maybe.withDefault(never)(fromString "[oi]n a (\\w+)")
val places : List[Match places = find location "I am on a boat in a lake."
// places.map(_.match) == List( "on a boat", "in a lake" ) // places.map(_.submatches) == List( List(Just "boat"), List(Just "lake") )
> Note: .submatches will always return an empty list