util.Regexp methods

Methods for the util.Regexp class.

Table 1. Class methods
Name Description
util.Regexp.compile(
  expr STRING
 )
  RETURNS util.Regexp
Compiles a regular expression and returns a util.Regexp object.
util.Regexp.getMatch(
  subject STRING
 )
  RETURNS STRING
Returns the text of the first (leftmost) match of the regular expression in the subject.
util.Regexp.getMatchAll(
  subject STRING
 )
  RETURNS DYNAMIC ARRAY OF STRING
Returns an array with all matches of the regular expression in the subject.
util.Regexp.getMatchIndex(
  subject STRING
 )
  RETURNS (INTEGER, INTEGER)
Returns the starting and ending position of the first (leftmost) match of the regular expression in the subject.
util.Regexp.getMatchIndexAll(
  subject STRING
 )
  RETURNS DYNAMIC ARRAY OF INTEGER
Returns an array with indexes to all matches of the regular expression in the subject.
util.Regexp.getSubmatch(
  subject STRING
 )
  RETURNS DYNAMIC ARRAY OF STRING
Returns an array with the sub-matches of the first match of regular expression in the subject.
util.Regexp.getSubmatchAll(
  subject STRING
 )
  RETURNS DYNAMIC ARRAY WITH DIMENSION 2 OF STRING
Returns 2-dimensional array with the sub-matches of all matches of regular expression in the subject.
util.Regexp.getSubmatchIndex(
  subject STRING
 )
  RETURNS DYNAMIC ARRAY OF INTEGER
Returns an array with the indexes of the sub-matches of the first match of regular expression in the subject.
util.Regexp.getSubmatchIndexAll(
  subject STRING
 )
  RETURNS DYNAMIC ARRAY WITH DIMENSION 2 OF INTEGER
Returns a 2-dimensional array with the indexes of the sub-matches of all matches of regular expression in the subject.
util.Regexp.matches(
  subject STRING
 )
  RETURNS BOOLEAN
Tests if a string contains any match of this regular expression.
util.Regexp.replaceAll(
  subject STRING,
  replacement STRING
 )
  RETURNS STRING
Substitutes all matches of the regular expression with the replacement string.
util.Regexp.replaceFirst(
  subject STRING,
  replacement STRING
 )
  RETURNS STRING
Substitutes the match of the regular expression with the replacement string.