Commit Graph
12 Commits
Author SHA1 Message Date
Martin Potter 1af8016a5c Regex fixes for substring parsing. 2014-08-04 14:42:35 -07:00
Zoltan Varga b99bbf419f Change some usages of ArrayList to List<T> to avoid calls to the slow ArrayList.ToArray(Type) method. 2011-01-06 13:17:01 +01:00
Raja R Harinath cd51491631 Fix a few cases of mixed line-endings
This is a scripted conversion of mixed line-ending files to LF-only or CRLF-only
based on which patch is smaller.  I used a threshold of upto a quarter of the
lines to determine whether to keep the patch or not.
2010-07-26 02:20:13 +05:30
Rodrigo Kumpera 22fb8fe69c 2010-02-03 Rodrigo Kumpera <[email protected]>
* BaseMachine.cs (Split): Don't add empty strings if they don't
	* come from
	the first capture group. Fixes #566117.

svn path=/trunk/mcs/; revision=150786
2010-02-03 21:10:16 +00:00
Zoltan Varga 09047c897a 2009-02-27 Zoltan Varga <[email protected]>
* BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an
	appropriate initial length.

svn path=/trunk/mcs/; revision=128158
2009-02-26 23:24:42 +00:00
Jb Evain e0e4361e63 cleanup System.ComponentModel for SL2
svn path=/trunk/mcs/; revision=109344
2008-07-31 13:49:49 +00:00
Zoltan Varga f1e948d1b0 2008-02-10 Zoltan Varga <[email protected]>
* replace.cs (NeedsGroupsOrCaptures): New property. Determines whenever the
	replacement process needs access to the groups or captures properties of the
	Match object.

	* Group.cs: Add an internal ctor which avoids allocations.

	* Match.cs: Ditto.

	* BaseMachine.cs interpreter.cs: Add an optimization to avoid fully creating
	Match objects during Replace () if the replacement string is simple.

svn path=/trunk/mcs/; revision=95394
2008-02-10 18:08:27 +00:00
Zoltan Varga 3dfa66b847 2008-02-10 Zoltan Varga <[email protected]>
* BaseMachine.cs Regex.cs: Make LTRReplace and RTLReplace instance methods to 
	avoid creating two machines for each Regex.Replace () call.

svn path=/trunk/mcs/; revision=95389
2008-02-10 17:32:04 +00:00
Raja R Harinath 01dbfb50d5 Fix 324390
In System/System.Text.RegularExpressions:
	* BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr'
	to deduce absence of matches -- a match can have length 0.
	(RTLReplace): Likewise.

In System/Test/System.Text.RegularExpressions:
	* RegexReplace.cs (tests): New test from #324390.

svn path=/trunk/mcs/; revision=89176
2007-11-08 03:31:44 +00:00
Raja R Harinath b35097bc0b Support RegexOptions.RightToLeft in Replace().
In b/class/System/System.Text.RegularExpressions:
	* BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace
	based on regex.
	(LTRReplace): Make internal and rename the MatchAppendEvaluator
	version of Replace to this.
	(RTLReplace): New.
	* Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine.
	* replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case.
	Based on patch by Stephane Delcroix.

In b/class/System/Test/System.Text.RegularExpressions:
	* MatchTest.cs (Match_Backref): New.
	* RegexReplace.cs (direction, testcase.direction): New.
	(testcase..ctor): Allow specifying the direction of the replace.
	(ReplaceTests): Test replace in both directions.
	(EvaluatorTests): New test based on #321036.

svn path=/trunk/mcs/; revision=89034
2007-11-06 22:03:35 +00:00
Arina Itkes 9d7c2d7c36 - Change Log updated for revisions 88065, 88356 and 88375
- Original Copyright is set on extracted by refactoring class BaseMachine.

svn path=/trunk/mcs/; revision=88390
2007-10-29 15:46:34 +00:00
Arina Itkes 61d27ad7fc - Refactoring of Interpreter with extracting of base abstract class that executes some methods that were moved from Regex and Match classes.
- Added a field that maps group numbers to group names in Regex for improvement of performance of GroupNameFromNumber method.

svn path=/trunk/mcs/; revision=88065
2007-10-24 14:18:57 +00:00