Companion

object Companion

Functions

escape
Link copied to clipboard
Common
fun escape(literal: String): String
fun escape(literal: String): String
fun escape(literal: String): String
fun escape(literal: String): String

Returns a regular expression pattern string that matches the specified literal string literally. No characters of that string will have special meaning when searching for an occurrence of the regular expression.

escapeReplacement
Link copied to clipboard
Common
fun escapeReplacement(literal: String): String
fun escapeReplacement(literal: String): String
fun escapeReplacement(literal: String): String
fun escapeReplacement(literal: String): String

Returns a literal replacement expression for the specified literal string. No characters of that string will have special meaning when it is used as a replacement string in Regex.replace function.

fromLiteral
Link copied to clipboard
Common
fun fromLiteral(literal: String): Regex
fun fromLiteral(literal: String): Regex
fun fromLiteral(literal: String): Regex
fun fromLiteral(literal: String): Regex

Returns a regular expression that matches the specified literal string literally. No characters of that string will have special meaning when searching for an occurrence of the regular expression.