JadeRegexPattern Methods

The methods defined in the JadeRegexPattern class are summarized in the following table.

Method Description
compile Compiles the Regex pattern using the specified pattern string.
contains Determines if the specified text contains an occurrence of the pattern. Unlike the isMatch method, this does not require the entire specified text to match; just a portion of it.
findAll Searches the entire specified text looking for all occurrences of the pattern. Any matches that are found are collated into a JadeRegexResult object.
findFirst Searches the specified text for the first occurrence of the specified pattern. If one is found, the details of the match are recorded as a JadeRegexMatch object.
findFirstInSubstring

Searches a portion of the specified text for the first occurrence of the specified pattern. If one is found within that portion, the details of the match are recorded as a JadeRegexMatch object.

isCompiled Determines if the pattern is compiled
isMatch Determines if the specified text completely matches the pattern. Note that for a match to occur, the pattern must match the entire specified text.
match Determines if the specified text completely matches the pattern. This is a more capable form of the isMatch method, as it records any match, including any capture groups specified in the pattern, as a JadeRegexMatch object.
replaceAll Replaces all occurrences of the pattern in the specified text with the replacement text.
replaceFirst Replaces only the first occurrence (if any) of the pattern in the specified text with the replacement text.
setAnchored Specifies that a match must start from the beginning of the string.
setDotAll Sets a dot meta‑character in the pattern to match any one character, including a new line (CrLf); that is, it changes the behavior of an existing dot (.) character.
setDuplicateNames Specifies that multiple named groups in a pattern can have the same name
setEnablePrefix Sets the option to cause the populating of the prefix property of JadeRegexMatch objects when performing Regex operations.
setEnableSuffix Sets the option to cause the populating of the suffix property of JadeRegexMatch objects when performing Regex operations.
setExplicitCapture

Sets the option to cause capture groups to be collated and returned as JadeRegexCapture objects with any match.

setExtendedReplace Makes the backslash character (\) a special character instead of only the dollar character ($) so that you can use \u or \U to change a single character or all characters, respectively, to uppercase.
setIgnoreCase Sets the option that causes the pattern to ignore case‑sensitivity with this pattern.
setIgnoreEmptyMatches Sets the option that filters out empty matches and does not create match objects for them. This applies to Regex operations that produce a Regex operation that requires a JadeRegexResult object such as a split method call.
setLiteral Disables all meta‑characters in the pattern and treats the pattern as a literal string.
setMultiline Specifies that the $ and ^ meta‑characters match the new line character
setTimeoutValue Specifies the period after which a single Regex operation times out.
setUngreedy Inverts the greediness of quantifiers within the pattern so that they are not greedy by default, but become greedy if followed by "?".
setUnicodeECMAScriptDialect Enables the Unicode ECMA script dialect.
split

Splits the specified text into substrings delimited by the pattern. The produced substrings are collated in a JadeRegexResult object.

splitSubstring

Splits the specified portion of the text into substrings using the Regex pattern as delimiters. The portion is defined by the specified start position and length. The produced substrings are collated in a JadeRegexResult object.

You can use the JadeRegexPattern class EndOfString constant instead of a literal length in substring matches; for example, in cases where you want to match from an offset to the end of the string in methods like splitSubstring.

2020.0.01 and higher