1 | static L<S> regexpGetGroups(Matcher matcher) { |
2 | int n = matcher.groupCount(); |
3 | new L<S> l; |
4 | for (int i = 1; i <= n; i++) |
5 | l.add(matcher.group(i)); |
6 | ret l; |
7 | } |
8 | |
9 | // performs find() |
10 | static L<S> regexpGetGroups(S pat, S s) { |
11 | Matcher m = regexpMatcher(pat, s); |
12 | if (m.find()) |
13 | ret regexpGetGroups(m); |
14 | null; |
15 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1012189 |
Snippet name: | regexpGetGroups - get groups from Matcher as list (does not include full match) |
Eternal ID of this version: | #1012189/3 |
Text MD5: | 50c4f1f5f252b183988d12d179d43ed3 |
Author: | stefan |
Category: | javax / regexp |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-10 14:54:18 |
Source code size: | 330 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 485 / 612 |
Version history: | 2 change(s) |
Referenced in: | [show references] |