Regex
Since Kotlin
1.0Represents a compiled regular expression. Provides functions to match strings in text with a pattern, replace the found occurrences and split text around matches.
For pattern syntax reference see MDN RegExp and http://www.w3schools.com/jsref/jsref_obj_regexp.asp.
Note that RegExp
objects under the hood are constructed with the "u" flag that enables Unicode-related features in regular expressions. This also makes the pattern syntax more strict, for example, prohibiting unnecessary escape sequences.
Since Kotlin
1.1Represents a compiled regular expression. Provides functions to match strings in text with a pattern, replace the found occurrences and split text around matches.
For pattern syntax reference see Pattern.
Since Kotlin
1.0Represents a compiled regular expression. Provides functions to match strings in text with a pattern, replace the found occurrences and split text around matches.
Since Kotlin
1.3Constructors
Types
Properties
The set of options that were used to create this regular expression.
The set of options that were used to create this regular expression.
The set of options that were used to create this regular expression.
Functions
Indicates whether the regular expression can find at least one match in the specified input.
Indicates whether the regular expression can find at least one match in the specified input.
Indicates whether the regular expression can find at least one match in the specified input.
Returns the first match of a regular expression in the input, beginning at the specified startIndex.
Returns the first match of a regular expression in the input, beginning at the specified startIndex.
Returns the first match of a regular expression in the input, beginning at the specified startIndex.
Returns the first match of a regular expression in the input, beginning at the specified startIndex.
Returns a sequence of all occurrences of a regular expression within the input string, beginning at the specified startIndex.
Returns a sequence of all occurrences of a regular expression within the input string, beginning at the specified startIndex.
Returns a sequence of all occurrences of a regular expression within the input string, beginning at the specified startIndex.
Returns a sequence of all occurrences of a regular expression within the input string, beginning at the specified startIndex.
Replaces all occurrences of this regular expression in the specified input string with the result of the given function transform that takes MatchResult and returns a string to be used as a replacement for that match.
Replaces all occurrences of this regular expression in the specified input string with specified replacement expression.
Replaces all occurrences of this regular expression in the specified input string with the result of the given function transform that takes MatchResult and returns a string to be used as a replacement for that match.
Replaces all occurrences of this regular expression in the specified input string with specified replacement expression.
Replaces all occurrences of this regular expression in the specified input string with the result of the given function transform that takes MatchResult and returns a string to be used as a replacement for that match.
Replaces all occurrences of this regular expression in the specified input string with specified replacement expression.
Replaces the first occurrence of this regular expression in the specified input string with specified replacement expression.
Replaces the first occurrence of this regular expression in the specified input string with specified replacement expression.
Replaces the first occurrence of this regular expression in the specified input string with specified replacement expression.
Splits the input CharSequence to a list of strings around matches of this regular expression.
Splits the input CharSequence to a list of strings around matches of this regular expression.
Splits the input CharSequence to a list of strings around matches of this regular expression.
Splits the input CharSequence to a sequence of strings around matches of this regular expression.
Splits the input CharSequence to a sequence of strings around matches of this regular expression.
Splits the input CharSequence to a sequence of strings around matches of this regular expression.
Splits the input CharSequence to a sequence of strings around matches of this regular expression.