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

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

Issue 15709018: Proof-of-concept matchPrefix on Pattern. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed other comments. Created 7 years, 6 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
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 part of dart.core; 5 part of dart.core;
6 6
7 abstract class Pattern { 7 abstract class Pattern {
8 /**
9 * Match this pattern against the string repeatedly.
10 *
11 * The iterable will contain all the non-overlapping matches of the
12 * pattern on the string, ordered by start index.
13 *
14 * The matches are found by repeatedly finding the first match
15 * of the pattern on the string, starting from the end of the previous
16 * match, and initially starting from index zero.
17 *
18 * If the pattern matches the empty string at some point, the next
19 * match is found by starting at the previous match's end plus one.
20 */
8 Iterable<Match> allMatches(String str); 21 Iterable<Match> allMatches(String str);
22
23 /**
24 * Match this pattern against the start of string.
25 *
26 * If [start] is provided, it must be an integer in the range `0` ..
27 * `string.length`. In that case, this patten is tested against the
28 * string at the [start] position. That is, a match is returned if the
29 * pattern can match a part of the string starting from position [start].
30 */
31 Match matchAsPrefix(String string, [int start = 0]);
9 } 32 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart ('k') | tests/corelib/string_pattern_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698