| 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 * A result from searching within a string. | 8 * A result from searching within a string. |
| 9 * | 9 * |
| 10 * A Match or an [Iterable] of Match objects is returned from [Pattern] | 10 * A Match or an [Iterable] of Match objects is returned from [Pattern] |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 * a string. | 111 * a string. |
| 112 * | 112 * |
| 113 * The following example finds all matches of a regular expression in | 113 * The following example finds all matches of a regular expression in |
| 114 * a string. | 114 * a string. |
| 115 * | 115 * |
| 116 * RegExp exp = new RegExp(r"(\w+)"); | 116 * RegExp exp = new RegExp(r"(\w+)"); |
| 117 * String str = "Parse my string"; | 117 * String str = "Parse my string"; |
| 118 * Iterable<Match> matches = exp.allMatches(str); | 118 * Iterable<Match> matches = exp.allMatches(str); |
| 119 */ | 119 */ |
| 120 abstract class RegExp implements Pattern { | 120 abstract class RegExp implements Pattern { |
| 121 @patch | 121 /** |
| 122 * Constructs a regular expression. |
| 123 * |
| 124 * Throws a [FormatException] if [source] is not valid regular |
| 125 * expression syntax. |
| 126 */ |
| 122 factory RegExp(String source, | 127 factory RegExp(String source, |
| 123 {bool multiLine: false, | 128 {bool multiLine: false, |
| 124 bool caseSensitive: true}) | 129 bool caseSensitive: true}) |
| 125 => new JSSyntaxRegExp(source, | 130 => new JSSyntaxRegExp(source, |
| 126 multiLine: multiLine, | 131 multiLine: multiLine, |
| 127 caseSensitive: caseSensitive); | 132 caseSensitive: caseSensitive); |
| 128 | 133 |
| 129 /** | 134 /** |
| 130 * Searches for the first match of the regular expression | 135 * Searches for the first match of the regular expression |
| 131 * in the string [input]. Returns `null` if there is no match. | 136 * in the string [input]. Returns `null` if there is no match. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 170 |
| 166 /** | 171 /** |
| 167 * Whether this regular expression is case sensitive. | 172 * Whether this regular expression is case sensitive. |
| 168 * | 173 * |
| 169 * If the regular expression is not case sensitive, it will match an input | 174 * If the regular expression is not case sensitive, it will match an input |
| 170 * letter with a pattern letter even if the two letters are different case | 175 * letter with a pattern letter even if the two letters are different case |
| 171 * versions of the same letter. | 176 * versions of the same letter. |
| 172 */ | 177 */ |
| 173 bool get isCaseSensitive; | 178 bool get isCaseSensitive; |
| 174 } | 179 } |
| OLD | NEW |