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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 * Returns the number of groups in the regular expression. | 55 * Returns the number of groups in the regular expression. |
56 */ | 56 */ |
57 int get groupCount; | 57 int get groupCount; |
58 | 58 |
59 /** | 59 /** |
60 * The string on which this matcher was computed. | 60 * The string on which this matcher was computed. |
61 */ | 61 */ |
62 String get str; | 62 String get str; |
63 | 63 |
64 /** | 64 /** |
65 * The pattern to search for in [str]. | 65 * The pattern used to search in [str]. |
66 */ | 66 */ |
67 Pattern get pattern; | 67 Pattern get pattern; |
68 } | 68 } |
69 | 69 |
70 | 70 |
71 /** | 71 /** |
72 * [RegExp] represents regular expressions. | 72 * [RegExp] represents regular expressions. |
73 * | 73 * |
74 * Dart regular expressions have the same syntax and semantics as | 74 * Dart regular expressions have the same syntax and semantics as |
75 * JavaScript regular expressions. See | 75 * JavaScript regular expressions. See |
(...skipping 10 matching lines...) Expand all Loading... |
86 * The following example finds all matches of a regular expression in | 86 * The following example finds all matches of a regular expression in |
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] and [ignoreCase] to false. | 96 * [RegExp] sets [multiLine] to false and [caseSensitive] to true. |
97 */ | 97 */ |
98 external factory RegExp(String pattern, {bool multiLine: false, | 98 external factory RegExp(String pattern, {bool multiLine: false, |
99 bool ignoreCase: false}); | 99 bool caseSensitive: true}); |
100 | 100 |
101 /** | 101 /** |
102 * Searches for the first match of the regular expression | 102 * Searches for the first match of the regular expression |
103 * in the string [str]. Returns `null` if there is no match. | 103 * in the string [str]. Returns `null` if there is no match. |
104 */ | 104 */ |
105 Match firstMatch(String str); | 105 Match firstMatch(String str); |
106 | 106 |
107 /** | 107 /** |
108 * Returns an iterable on the matches of the regular | 108 * Returns an iterable on the matches of the regular |
109 * expression in [str]. | 109 * expression in [str]. |
(...skipping 12 matching lines...) Expand all Loading... |
122 String stringMatch(String str); | 122 String stringMatch(String str); |
123 | 123 |
124 /** | 124 /** |
125 * The pattern of this regular expression. | 125 * The pattern of this regular expression. |
126 */ | 126 */ |
127 String get pattern; | 127 String get pattern; |
128 | 128 |
129 /** | 129 /** |
130 * Whether this regular expression matches multiple lines. | 130 * Whether this regular expression matches multiple lines. |
131 */ | 131 */ |
132 bool get multiLine; | 132 bool get isMultiLine; |
133 | 133 |
134 /** | 134 /** |
135 * Whether this regular expression is case insensitive. | 135 * Whether this regular expression is case insensitive. |
136 */ | 136 */ |
137 bool get ignoreCase; | 137 bool get isCaseSensitive; |
138 } | 138 } |
OLD | NEW |