regexp
Table of Contents
Function
regexp — perform a regular expression search on a string
Synopsis
regexp(re: string|regexp, s: string) -> any
Description
The regexp function returns an array of strings holding the text
of the left most match of the regular expression re
, which can be either
a string value or a regular expression,
and the matches of each parenthesized subexpression (also known as capturing
groups) if there are any. A null value indicates no match.
Examples
Regexp returns an array of the match and its subexpressions:
yield regexp(/foo(.?) (\w+) fr.*/, this)
"seafood
fool
friend"
Loading...
A null is returned if there is no match:
yield regexp("bar", this)
"foo"
Loading...