| 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. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 * a string. | 87 * a string. |
| 88 * | 88 * |
| 89 * RegExp exp = new RegExp(r"(\w+)"); | 89 * RegExp exp = new RegExp(r"(\w+)"); |
| 90 * String str = "Parse my string"; | 90 * String str = "Parse my string"; |
| 91 * Iterable<Match> matches = exp.allMatches(str); | 91 * Iterable<Match> matches = exp.allMatches(str); |
| 92 */ | 92 */ |
| 93 abstract class RegExp implements Pattern { | 93 abstract class RegExp implements Pattern { |
| 94 /** | 94 /** |
| 95 * Constructs a regular expression. The default implementation of a | 95 * Constructs a regular expression. The default implementation of a |
| 96 * [RegExp] sets [multiLine] to false and [caseSensitive] to true. | 96 * [RegExp] sets [multiLine] to false and [caseSensitive] to true. |
| 97 * Throws a [FormatException] if [pattern] is not a valid regular |
| 98 * exression pattern. |
| 97 */ | 99 */ |
| 98 external factory RegExp(String pattern, {bool multiLine: false, | 100 external factory RegExp(String pattern, {bool multiLine: false, |
| 99 bool caseSensitive: true}); | 101 bool caseSensitive: true}); |
| 100 | 102 |
| 101 /** | 103 /** |
| 102 * Searches for the first match of the regular expression | 104 * Searches for the first match of the regular expression |
| 103 * in the string [str]. Returns `null` if there is no match. | 105 * in the string [str]. Returns `null` if there is no match. |
| 104 */ | 106 */ |
| 105 Match firstMatch(String str); | 107 Match firstMatch(String str); |
| 106 | 108 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 129 /** | 131 /** |
| 130 * Whether this regular expression matches multiple lines. | 132 * Whether this regular expression matches multiple lines. |
| 131 */ | 133 */ |
| 132 bool get isMultiLine; | 134 bool get isMultiLine; |
| 133 | 135 |
| 134 /** | 136 /** |
| 135 * Whether this regular expression is case insensitive. | 137 * Whether this regular expression is case insensitive. |
| 136 */ | 138 */ |
| 137 bool get isCaseSensitive; | 139 bool get isCaseSensitive; |
| 138 } | 140 } |
| OLD | NEW |