← Docs
kotlin-stdlib / kotlin.text / matches

matches

Common
JVM
JS
Native
1.0
infix fun CharSequence . matches ( regex : Regex ) : Boolean
(source)

Returns true if this char sequence matches the given regular expression.

JS
1.1
@DeprecatedSinceKotlin ( "1.6" ) fun String . matches (
regex : String
) : Boolean

(source)
Deprecated: Use Regex.matches() instead
Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .