regexIsMatch
Evaluates whether the input
string matches the case-sensitive regular expression pattern
. Evaluates to null if the input
string is null. The pattern
string must not be null.
Used in the following format, where input
and pattern
must be a string:
regexIsMatch(input, pattern)
The return value type is a Boolean.
Examples
regexIsMatch("brain", "a") # value: true
"brain".regexIsMatch("a") # value: true
regexIsMatch("brain", "^a") # value: false
"brain".regexIsMatch("^a") # value: false
regexIsMatch("brain", "A") # value: false
"brain".regexIsMatch("A") # value: false
regexIsMatch("brain", "a.n") # value: true
"brain".regexIsMatch("a.n") # value: true
regexIsMatch("brain", "\\d+") # value: false
"brain".regexIsMatch("\\d+") # value: false
regexIsMatch("brain123", "\\d+") # value: true
"brain123".regexIsMatch("\\d+") # value: true
regexIsMatchI
Case-insensitive version of the regexIsMatch operator.
Used in the following format, where pattern
and input
must be a string:
regexIsMatchI(input, pattern)
input.regexIsMatchI(pattern)
The return value type is a Boolean.
Examples
regexIsMatchI("brain", "a") # value: true
"brain".regexIsMatchI("a") # value: true
regexIsMatchI("brain", "A") # value: true
"brain".regexIsMatchI("A") # value: true
regexMatch
The result value is a list of the matches. Each match is also a list, where the first element is the total consumed substring. Any subsequent elements correspond to the sub-capture groupings (marked by parentheses in the pattern string). The operator consumes the input string as it matches, so the set of matches are not all possible matches, but instead are mutually exclusive matches found greedily. If the count parameter is not specified or is negative then the operator will continue attempting to match the remaining string until it fails. Otherwise, only the specified number of matches are attempted. Evaluates to null if the input string is null. The pattern string and count parameter must not be null.
Used in the following format, where pattern
and input
must be a string and count
must be an integer:
regexMatch(input, pattern, [count])
The return value type is a list.
Examples
regexMatch("brain", "." ) # value: { {"b"} {"r"} {"a"} {"i"}
"brain".regexMatch("." ) # value: { {"b"} {"r"} {"a"} {"i"}
regexMatch("brain", ".", 3) # value: { {"b"} {"r"} {"a"} }
"brain".regexMatch(".", 3) # value: { {"b"} {"r"} {"a"} }
regexMatch("brain", "ai") # value: { {"ai"} }
"brain".regexMatch("ai") # value: { {"ai"} }
regexMatch("brain", ".(.)") # value: { {"br" "r"} {"ai" "i"} }
"brain".regexMatch(".(.)") # value: { {"br" "r"} {"ai" "i"} }
regexMatch("brain", ".((.).)") # value: { {"bra" "ra" "r"} }
"brain".regexMatch(".((.).)") # value: { {"bra" "ra" "r"} }
regexMatchI
Case-insensitive version of the regexMatch operator.
Used in the following format, where pattern
and input
must be a string and count
must be an integer:
regexMatchI(input, pattern, [count])
input.regexMatchI(pattern, [count])
The return value type is a list.
Examples
regexMatchI("brain", "Ai") # value: { {"ai"} }
"brain".regexMatchI("Ai") # value: { {"ai"} }
regexMatchI("brain", "R(.)") # value: { {"ra" "a"} }
"brain".regexMatchI("R(.)") # value: { {"ra" "a"} }
regexSubstitute
Replaces matches of the case-sensitive regular expression pattern
in the input
string. The value of sub-pattern groupings (marked by parentheses in the pattern
string) may be referenced in the replacement
string by preceding the ordinal position of the grouping (one-based) with a dollar sign ($). The operator consumes the input
string as it matches, so the set of matches are not all possible matches, but instead are mutually exclusive matches found greedily. If the count
parameter is not specified or is negative then the operator will continue attempting to match the remaining string until it fails. Otherwise, only the specified number of matches are attempted. Evaluates to null if the input
string is null. A null replacement
parameter is treated equivalent to the empty string. The pattern
string and count
parameter must not be null.
Used in the following format, where pattern
, replacement
and input
must be a string and count
must be an integer:
regexSubstitute(input, pattern, replacement, [count])
input.regexSubstitute(pattern, replacement, [count])
The return value type is a string.
Examples
regexSubstitute( "ababab", "a", "") # value: "bbb"
"ababab".regexSubstitute("a", "") # value: "bbb"
regexSubstitute("ababab", "a", "", 2) # value: "bbab"
"ababab".regexSubstitute("a", "", 2) # value: "bbab"
regexSubstitute("brain", ".", "x", 2) # value: "xxain"
"brain".regexSubstitute(".", "x", 2) # value: "xxain"
regexSubstitute("123456", ".(.).", "$1") # value: "25"
"123456".regexSubstitute(".(.).", "$1") # value: "25"
regexSubstituteI
Case-insensitive version of the regexSubstitute operator.
Used in the following format, where pattern
, replacement
and input
must be a string and count
must be an integer:
regexSubstituteI(input, pattern, replacement, [count])
input.regexSubstituteI(pattern, replacement, [count])
The return value type is a string.
Examples
regexSubstituteI("abAbab", "a", "" ) # value: "bbb"
"abAbab".regexSubstituteI("a", "" ) # value: "bbb"
regexSubstituteI("abAbab", "a", "", 2) # value: "bbab"
"abAbab".regexSubstituteI("a", "", 2) # value: "bbab"