[dart-announce] API CHANGE: Adding optional "start" parameter to Pattern.allMatches

29 views
Skip to first unread message

'Lasse R.H. Nielsen' via Dart Announcements

unread,
Aug 19, 2014, 3:26:17 AM8/19/14
to anno...@dartlang.org
In v1.6 of the Dart SDK, we are adding an extra, optional, start
parameter to Pattern.allMatches. This makes matching start at the
start index, and not at index zero.

Existing correct programs will not be affected, the change itself is
entirely backwards compatible.

If you are implementing Pattern, you will want to add the extra
parameter. Most implementations of allMatches will already need to do
matching at positions different from zero, so the change is expected
to be trivial - just start at the "start" index instead of zero when
finding the matches. Update the minimum SDK version of your package to
1.6.

If you decide to *use* the optional parameter, you should update your
SDK version dependecy to be 1.6, and be careful if using Pattern
implementations from packages that don't depend on SDK version 1.6,
since they may not have been updated yet.

This change was introduced because there is no good workaround for
doing a pattern search from a start index different from zero.
We want this functionality in order to allow a start index on
String.replaceFirst, and other similar functionality.

Cheers
/L
--
Lasse R.H. Nielsen - l...@google.com
'Faith without judgement merely degrades the spirit divine'
Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K -
Denmark - CVR nr. 28 86 69 84

--
For more news and information, visit http://news.dartlang.org/

To join the conversation, visit https://groups.google.com/a/dartlang.org/
Reply all
Reply to author
Forward
0 new messages