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

Unified Diff: tool/input_sdk/lib/core/regexp.dart

Issue 1944413006: Updates for core/{pattern,regexp,stopwatch,duration}.dart (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tool/input_sdk/lib/core/pattern.dart ('k') | tool/input_sdk/lib/core/stopwatch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/lib/core/regexp.dart
diff --git a/tool/input_sdk/lib/core/regexp.dart b/tool/input_sdk/lib/core/regexp.dart
index 049ff9744770f636a544b185aa6187c873a4bdc6..09874c4c1117e77f8addbf1e05103866bd46052c 100644
--- a/tool/input_sdk/lib/core/regexp.dart
+++ b/tool/input_sdk/lib/core/regexp.dart
@@ -5,94 +5,6 @@
part of dart.core;
/**
- * A result from searching within a string.
- *
- * A Match or an [Iterable] of Match objects is returned from [Pattern]
- * matching methods.
- *
- * The following example finds all matches of a [RegExp] in a [String]
- * and iterates through the returned iterable of Match objects.
- *
- * RegExp exp = new RegExp(r"(\w+)");
- * String str = "Parse my string";
- * Iterable<Match> matches = exp.allMatches(str);
- * for (Match m in matches) {
- * String match = m.group(0);
- * print(match);
- * }
- *
- * The output of the example is:
- *
- * Parse
- * my
- * string
- *
- * Some patterns, regular expressions in particular, may record subtrings
- * that were part of the matching. These are called _groups_ in the Match
- * object. Some patterns may never have any groups, and their matches always
- * have zero [groupCount].
- */
-abstract class Match {
- /**
- * Returns the index in the string where the match starts.
- */
- int get start;
-
- /**
- * Returns the index in the string after the last character of the
- * match.
- */
- int get end;
-
- /**
- * Returns the string matched by the given [group].
- *
- * If [group] is 0, returns the match of the pattern.
- *
- * The result may be `null` if the pattern didn't assign a value to it
- * as part of this match.
- */
- String group(int group);
-
- /**
- * Returns the string matched by the given [group].
- *
- * If [group] is 0, returns the match of the pattern.
- *
- * Short alias for [Match.group].
- */
- String operator [](int group);
-
- /**
- * Returns a list of the groups with the given indices.
- *
- * The list contains the strings returned by [group] for each index in
- * [groupIndices].
- */
- List<String> groups(List<int> groupIndices);
-
- /**
- * Returns the number of captured groups in the match.
- *
- * Some patterns may capture parts of the input that was used to
- * compute the full match. This is the number of captured groups,
- * which is also the maximal allowed argument to the [group] method.
- */
- int get groupCount;
-
- /**
- * The string on which this match was computed.
- */
- String get input;
-
- /**
- * The pattern used to search in [input].
- */
- Pattern get pattern;
-}
-
-
-/**
* A regular expression pattern.
*
* Regular expressions are [Pattern]s, and can as such be used to match strings
@@ -116,6 +28,10 @@ abstract class Match {
* RegExp exp = new RegExp(r"(\w+)");
* String str = "Parse my string";
* Iterable<Match> matches = exp.allMatches(str);
+ *
+ * Note the use of a _raw string_ (a string prefixed with `r`)
+ * in the example above. Use a raw string to treat each character in a string
+ * as a literal character.
*/
abstract class RegExp implements Pattern {
/**
« no previous file with comments | « tool/input_sdk/lib/core/pattern.dart ('k') | tool/input_sdk/lib/core/stopwatch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698