Skip to content

Matching sub strings

Matching sub-stringsλ︎

re-find returns the first match within the string, using return values similar to re-matches.

nil is returned when the pattern does not find a match.

(re-find #"pump" "Halloween")

A matching pattern without groups returns the matched string

(re-find #"e+" "Halloween")

Match with groups returns a vector of results

(re-find #"s+(.*)(s+)" "success")