Closed
Description
The following works fine under both platforms:
val matcher = Pattern.compile("\\d+").matcher("2147483647")
matcher.find()
matcher.groupCount
The following fails in js
but not jvm
:
val matcher = Pattern.compile("\\d+").matcher("2147483647")
//matcher.find()
matcher.groupCount
There's nothing in the Matcher
scaladoc that seems to imply that calling find
before groupCount
is needed.
It does, however, seem like an unfixable bug. I'm no javascript expert, but it does rather look that regexes can only expose the group count for a given match, not for a matcher.