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.0Constructors
Types
Properties
Functions
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.
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.
Returns the string representation of this regular expression, namely the pattern of this regular expression.