RegExp
It is wrapper of Golang RegExp.
module methods:
value methods:
:
Returns a new regular expression value.
(RegExp: expr(string)) -> RegExp
match?
Reports whether source
contains any match of the regular expression.
(RegExp match? source(string)) -> bool
expr
Returns source text to compile regular expression.
(RegExp expr) -> string
groups
Returns the number of parenthesized subexpressions in the regular expression.
(RegExp groups) -> int
names
Returns the names of the parenthesized subexpressions in the regular expression.
(RegExp names) -> [string...]
literal_prefix
Returns a 2-element list [literal
boolean
], where literal
string that must begin any
match of the regular expression. It returns the boolean
true if the literal
string
comprises the entire regular expression.
(RegExp literal_prefix) -> [string, boolean]
longest
Makes future searches prefer the leftmost-longest match.
(RegExp longest) -> self
find
Returns a string holding the text of the leftmost match in s of the regular expression. If there is no match, the return value is an empty string, but it will also be empty if the regular expression successfully matches an empty string.
(RegExp find s(string)) -> string
find_all
Returns a list of all successive matches of the expression.
i
finger out number of results you want.
(RegExp find_all s(string) [i(int)]) -> [string...]