OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * [Match] contains methods to manipulate a regular expression match. | 8 * [Match] contains methods to manipulate a regular expression match. |
9 * | 9 * |
10 * Iterables of [Match] objects are returned from [RegExp] matching methods. | 10 * Iterables of [Match] objects are returned from [RegExp] matching methods. |
11 * | 11 * |
12 * The following example finds all matches of a [RegExp] in a [String] | 12 * The following example finds all matches of a [RegExp] in a [String] |
13 * and iterates through the returned iterable of [Match] objects. | 13 * and iterates through the returned iterable of [Match] objects. |
14 * | 14 * |
15 * RegExp exp = new RegExp(r"(\w+)"); | 15 * RegExp exp = new RegExp(r"(\w+)"); |
16 * String str = "Parse my string"; | 16 * String str = "Parse my string"; |
17 * Iterable<Match> matches = exp.allMatches(str); | 17 * Iterable<Match> matches = exp.allMatches(str); |
18 * for (Match m in matches) { | 18 * for (Match m in matches) { |
19 * String match = m.group(0); | 19 * String match = m.group(0); |
20 * print(match); | 20 * print(match); |
21 * }; | 21 * } |
22 * | 22 * |
23 * The output of the example is: | 23 * The output of the example is: |
24 * | 24 * |
25 * Parse | 25 * Parse |
26 * my | 26 * my |
27 * string | 27 * string |
28 */ | 28 */ |
29 abstract class Match { | 29 abstract class Match { |
30 /** | 30 /** |
31 * Returns the index in the string where the match starts. | 31 * Returns the index in the string where the match starts. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 /** | 131 /** |
132 * Whether this regular expression matches multiple lines. | 132 * Whether this regular expression matches multiple lines. |
133 */ | 133 */ |
134 bool get isMultiLine; | 134 bool get isMultiLine; |
135 | 135 |
136 /** | 136 /** |
137 * Whether this regular expression is case insensitive. | 137 * Whether this regular expression is case insensitive. |
138 */ | 138 */ |
139 bool get isCaseSensitive; | 139 bool get isCaseSensitive; |
140 } | 140 } |
OLD | NEW |