1 | getMatch();↵ | | 1 | Vector();↵
|
2 | int cnt = mr.groups();↵ | | 2 | int cnt = reg.getParenCount();↵
|
3 | for (int i = 0; i < cnt; i++) {↵ | | 3 | for (int i = 0; i < cnt; i++) {↵
|
4 | String match = mr.group(i);↵ | | 4 | String match = reg.getParen(i);↵
|
5 | // treat non-matching groups as empty matches↵ | | 5 | // treat non-matching groups as empty matches↵
|
6 | if (match == null) {↵ | | 6 | if (match == null) {↵
|
7 | match = "";↵ | | 7 | match = "";↵
|
8 | }↵ | | 8 | }↵
|
9 | v.addElement(match);↵ | | 9 | v.addElement(match);↵
|
10 | }↵ | | 10 | }↵
|
11 | return v;↵ | | 11 | return v;↵
|
12 | }↵ | | 12 | }↵
|
|
13 | /**↵ | | 13 | /**↵
|
14 | * Convert the generic options to the regex compiler specific options.↵ | | 14 | * Convert the generic options to the regex compiler specific options.↵
|
15 | * @param options the generic options↵ | | 15 | * @param options the generic options↵
|
16 | * @return the specific options↵ | | 16 | * @return the specific options↵
|
17 | */↵ | | 17 | */↵
|
18 | protected int getCompilerOptions(int options) {↵ | | 18 | protected int getCompilerOptions(int options) {↵
|
19 | int cOptions = Perl5Compiler.DEFAULT_MASK;↵ | | 19 | int cOptions = RE.MATCH_NORMAL;↵
|
|
20 | if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {↵ | | 20 | if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {↵
|
21 | cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK;↵ | | 21 | cOptions |= RE.MATCH_CASEINDEPENDENT;↵
|
22 | }↵ | | 22 | }↵
|
23 | if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {↵ | | 23 | if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {↵
|
24 | cOptions |= Perl5Compiler.MULTILINE_MASK;↵ | | 24 | cOptions |= RE.MATCH_MULTILINE;↵
|
25 | }↵ | | 25 | }↵
|
26 | if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {↵ | | 26 | if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {↵
|
27 | cOptions |= Perl5Compiler.SINGLELINE_MASK;↵ | | 27 | cOptions |= RE.MATCH_SINGLELINE;↵
|
28 | }↵ | | 28 | }↵
|
|
29 | return cOptions;↵ | | 29 | return cOptions;↵
|
30 | | | 30 |
|