| 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 /** | 5 /** |
| 6 * [Match] contains methods to manipulate a regular expression match. | 6 * [Match] contains methods to manipulate a regular expression match. |
| 7 * | 7 * |
| 8 * Iterables of [Match] objects are returned from [RegExp] matching methods. | 8 * Iterables of [Match] objects are returned from [RegExp] matching methods. |
| 9 * | 9 * |
| 10 * The following example finds all matches of a [RegExp] in a [String] | 10 * The following example finds all matches of a [RegExp] in a [String] |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 * a string. | 82 * a string. |
| 83 * | 83 * |
| 84 * The following example finds all matches of a regular expression in | 84 * The following example finds all matches of a regular expression in |
| 85 * a string. | 85 * a string. |
| 86 * | 86 * |
| 87 * RegExp exp = const RegExp(@"(\w+)"); | 87 * RegExp exp = const RegExp(@"(\w+)"); |
| 88 * String str = "Parse my string"; | 88 * String str = "Parse my string"; |
| 89 * Iterable<Match> matches = exp.allMatches(str); | 89 * Iterable<Match> matches = exp.allMatches(str); |
| 90 */ | 90 */ |
| 91 interface RegExp extends Pattern default JSSyntaxRegExp { | 91 interface RegExp extends Pattern default JSSyntaxRegExp { |
| 92 | |
| 93 /** | 92 /** |
| 94 * Constructs a regular expression. The default implementation of a | 93 * Constructs a regular expression. The default implementation of a |
| 95 * [RegExp] sets [multiLine] and [ignoreCase] to false. | 94 * [RegExp] sets [multiLine] and [ignoreCase] to false. |
| 96 */ | 95 */ |
| 97 const RegExp(String pattern, {bool multiLine: false, | 96 const RegExp(String pattern, {bool multiLine: false, |
| 98 bool ignoreCase: false}); | 97 bool ignoreCase: false}); |
| 99 | 98 |
| 100 /** | 99 /** |
| 101 * Searches for the first match of the regular expression | 100 * Searches for the first match of the regular expression |
| 102 * in the string [str]. Returns `null` if there is no match. | 101 * in the string [str]. Returns `null` if there is no match. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 128 /** | 127 /** |
| 129 * Whether this regular expression matches multiple lines. | 128 * Whether this regular expression matches multiple lines. |
| 130 */ | 129 */ |
| 131 bool get multiLine; | 130 bool get multiLine; |
| 132 | 131 |
| 133 /** | 132 /** |
| 134 * Whether this regular expression is case insensitive. | 133 * Whether this regular expression is case insensitive. |
| 135 */ | 134 */ |
| 136 bool get ignoreCase; | 135 bool get ignoreCase; |
| 137 } | 136 } |
| OLD | NEW |