Regex does not match in Kotlin
1 answer
You want to match all input with matchEntire
and a \d+
pattern:
fun matchEntire(input: CharSequence): MatchResult? (source)
Trying to match the entire CharSequence input to a pattern.
Returns a MatchResult instance if all input matches, or null otherwise.
However, it A123B
consists not only of numbers. If you need to find a partial match, use find
.
+3
source to share