public native group(index as Int = 0) as String
Returns the text captured by the current match or one of its groups.
| Parameter | Description |
|---|---|
index | Zero-based capture-group index. Group 0 is the full match. |
The captured text, or null when an optional group did not participate.
matcher = RegEx(r"([A-Za-z]+):(\d+)").matcher("alpha:12")
if matcher.find():
print(matcher.group()) # alpha:12
print(matcher.group(1)) # alpha