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

Side by Side Diff: corelib/src/regexp.dart

Issue 10825242: Revert "Fix dartdoc block code comments in Dart API that are broken and use [: :] delimiters." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months 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 | « corelib/src/expect.dart ('k') | runtime/bin/input_stream.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 = const RegExp(@"(\w+)"); 13 * [:
14 * String str = "Parse my string"; 14 * RegExp exp = const RegExp(@"(\w+)");
15 * Iterable<Match> matches = exp.allMatches(str); 15 * String str = "Parse my string";
16 * for (Match m in matches) { 16 * Iterable<Match> matches = exp.allMatches(str);
17 * String match = m.group(0); 17 * for (Match m in matches) {
18 * print(match); 18 * String match = m.group(0);
19 * }; 19 * print(match);
20 * };
21 * :]
20 * 22 *
21 * The output of the example is: 23 * The output of the example is:
22 * 24 *
23 * Parse 25 * [:
24 * my 26 * Parse
25 * string 27 * my
28 * string
29 * :]
26 */ 30 */
27 interface Match { 31 interface Match {
28 /** 32 /**
29 * Returns the index in the string where the match starts. 33 * Returns the index in the string where the match starts.
30 */ 34 */
31 int start(); 35 int start();
32 36
33 /** 37 /**
34 * Returns the index in the string after the last character of the 38 * Returns the index in the string after the last character of the
35 * match. 39 * match.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 * [firstMatch] is the main implementation method that applies a regular 76 * [firstMatch] is the main implementation method that applies a regular
73 * expression to a string and returns the first [Match]. All 77 * expression to a string and returns the first [Match]. All
74 * other methods in [RegExp] can build on it. 78 * other methods in [RegExp] can build on it.
75 * 79 *
76 * Use [allMatches] to look for all matches of a regular expression in 80 * Use [allMatches] to look for all matches of a regular expression in
77 * a string. 81 * a string.
78 * 82 *
79 * The following example finds all matches of a regular expression in 83 * The following example finds all matches of a regular expression in
80 * a string. 84 * a string.
81 * 85 *
82 * RegExp exp = const RegExp(@"(\w+)"); 86 * [:
83 * String str = "Parse my string"; 87 * RegExp exp = const RegExp(@"(\w+)");
84 * Iterable<Match> matches = exp.allMatches(str); 88 * String str = "Parse my string";
89 * Iterable<Match> matches = exp.allMatches(str);
90 * :]
85 */ 91 */
86 interface RegExp extends Pattern default JSSyntaxRegExp { 92 interface RegExp extends Pattern default JSSyntaxRegExp {
87 93
88 /** 94 /**
89 * Constructs a regular expression. The default implementation of a 95 * Constructs a regular expression. The default implementation of a
90 * [RegExp] sets [multiLine] and [ignoreCase] to false. 96 * [RegExp] sets [multiLine] and [ignoreCase] to false.
91 */ 97 */
92 const RegExp(String pattern, [bool multiLine, bool ignoreCase]); 98 const RegExp(String pattern, [bool multiLine, bool ignoreCase]);
93 99
94 /** 100 /**
95 * Searches for the first match of the regular expression 101 * Searches for the first match of the regular expression
96 * in the string [str]. Returns `null` if there is no match. 102 * in the string [str]. Returns [:null:] if there is no match.
97 */ 103 */
98 Match firstMatch(String str); 104 Match firstMatch(String str);
99 105
100 /** 106 /**
101 * Returns an iterable on the matches of the regular 107 * Returns an iterable on the matches of the regular
102 * expression in [str]. 108 * expression in [str].
103 */ 109 */
104 Iterable<Match> allMatches(String str); 110 Iterable<Match> allMatches(String str);
105 111
106 /** 112 /**
(...skipping 15 matching lines...) Expand all
122 /** 128 /**
123 * Whether this regular expression matches multiple lines. 129 * Whether this regular expression matches multiple lines.
124 */ 130 */
125 final bool multiLine; 131 final bool multiLine;
126 132
127 /** 133 /**
128 * Whether this regular expression is case insensitive. 134 * Whether this regular expression is case insensitive.
129 */ 135 */
130 final bool ignoreCase; 136 final bool ignoreCase;
131 } 137 }
OLDNEW
« no previous file with comments | « corelib/src/expect.dart ('k') | runtime/bin/input_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698