Getting one
Pattern.compile(…):matcher(…):toMatchResult()
Methods
| Method | Returns | Description |
|---|
group() | string? | (MatchResult) -> string?: The matched text, or nil when the groups were forgotten (usePattern). Raises IllegalStateException with no… |
|---|
group(number) | string? |
|---|
start() | number | (MatchResult) -> number: Where the match starts (a UTF-16 index). |
|---|
start(number) | number |
|---|
end_() | number | (MatchResult) -> number: end(), spelled end_ because Luau reserves end: where the match ends (exclusive). |
|---|
end_(number) | number |
|---|
groupCount() | number | How many capturing groups the pattern has. |
|---|
Method details
group: ((MatchResult) -> string?) & ((MatchResult, number) -> string?)
(MatchResult) -> string?: The matched text, or nil when the groups were forgotten (usePattern). Raises IllegalStateException with no match.
(MatchResult, number) -> string?: Group group's text, or nil when it did not take part (0 is the whole match).
start: ((MatchResult) -> number) & ((MatchResult, number) -> number)
(MatchResult) -> number: Where the match starts (a UTF-16 index).
(MatchResult, number) -> number: Where group group starts, or -1.
end_: ((MatchResult) -> number) & ((MatchResult, number) -> number)
(MatchResult) -> number: end(), spelled end_ because Luau reserves end: where the match ends (exclusive).
(MatchResult, number) -> number: end(group), spelled end_ because Luau reserves end: where group group ends, or -1.
Luau reserves end, so this member is spelled end_; it behaves exactly as end.
groupCount: (MatchResult) -> number
How many capturing groups the pattern has.