Handbook
Glossary
Matching operations with regular expressions
Regular expressions
Prev:
Constructing regular expressions
Next:
Regular expression capture groups
Testing if a string matches a regular expression:
matches?
( string regexp -- ? )
Finding a match inside a string:
re-contains?
( string regexp -- ? )
first-match
( string regexp -- slice/f )
first-match-with-captures
( string regexp -- match/f )
Finding all matches inside a string:
count-matches
( string regexp -- n )
all-matching-slices
( string regexp -- seq )
all-matching-subseqs
( string regexp -- seq )
all-matches-with-captures
( string regexp -- matches )
Retrieving captured text and its coordinates:
capture
( group match -- slice/f )
capture-bounds
( group match -- from/f to/f )
Splitting a string into tokens delimited by a regular expression:
re-split
( string regexp -- seq )
Replacing occurrences of a regular expression with a string:
re-replace
( string regexp replacement -- result )
re-replace-with
( string regexp quot: ( slice -- replacement ) -- result )