Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: sdk/lib/core/regexp.dart

Issue 11312203: "Reverting 14829-14832" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/core/date.dart ('k') | sdk/lib/coreimpl/regexp.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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]
11 * and iterates through the returned iterable of [Match] objects. 11 * and iterates through the returned iterable of [Match] objects.
12 * 12 *
13 * RegExp exp = new RegExp(r"(\w+)"); 13 * RegExp exp = const RegExp(r"(\w+)");
14 * String str = "Parse my string"; 14 * String str = "Parse my string";
15 * Iterable<Match> matches = exp.allMatches(str); 15 * Iterable<Match> matches = exp.allMatches(str);
16 * for (Match m in matches) { 16 * for (Match m in matches) {
17 * String match = m.group(0); 17 * String match = m.group(0);
18 * print(match); 18 * print(match);
19 * }; 19 * };
20 * 20 *
21 * The output of the example is: 21 * The output of the example is:
22 * 22 *
23 * Parse 23 * Parse
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 * [firstMatch] is the main implementation method that applies a regular 77 * [firstMatch] is the main implementation method that applies a regular
78 * expression to a string and returns the first [Match]. All 78 * expression to a string and returns the first [Match]. All
79 * other methods in [RegExp] can build on it. 79 * other methods in [RegExp] can build on it.
80 * 80 *
81 * Use [allMatches] to look for all matches of a regular expression in 81 * Use [allMatches] to look for all matches of a regular expression in
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 = new RegExp(r"(\w+)"); 87 * RegExp exp = const RegExp(r"(\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 /** 92 /**
93 * Constructs a regular expression. The default implementation of a 93 * Constructs a regular expression. The default implementation of a
94 * [RegExp] sets [multiLine] and [ignoreCase] to false. 94 * [RegExp] sets [multiLine] and [ignoreCase] to false.
95 */ 95 */
96 RegExp(String pattern, {bool multiLine: false, 96 const RegExp(String pattern, {bool multiLine: false,
97 bool ignoreCase: false}); 97 bool ignoreCase: false});
98 98
99 /** 99 /**
100 * Searches for the first match of the regular expression 100 * Searches for the first match of the regular expression
101 * in the string [str]. Returns `null` if there is no match. 101 * in the string [str]. Returns `null` if there is no match.
102 */ 102 */
103 Match firstMatch(String str); 103 Match firstMatch(String str);
104 104
105 /** 105 /**
106 * Returns an iterable on the matches of the regular 106 * Returns an iterable on the matches of the regular
107 * expression in [str]. 107 * expression in [str].
(...skipping 19 matching lines...) Expand all
127 /** 127 /**
128 * Whether this regular expression matches multiple lines. 128 * Whether this regular expression matches multiple lines.
129 */ 129 */
130 bool get multiLine; 130 bool get multiLine;
131 131
132 /** 132 /**
133 * Whether this regular expression is case insensitive. 133 * Whether this regular expression is case insensitive.
134 */ 134 */
135 bool get ignoreCase; 135 bool get ignoreCase;
136 } 136 }
OLDNEW
« no previous file with comments | « sdk/lib/core/date.dart ('k') | sdk/lib/coreimpl/regexp.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698