1 2007-01-02 Raja R Harinath <rharinath@novell.com>
4 * parser.cs (Parser.GetMapping): Use the actual group numbers to
7 2006-09-28 Andrew Skiba <andrews@mainsoft.com>
11 2006-05-30 Gert Driesen <drieseng@users.sourceforge.net>
13 * CaptureCollection.cs: Removed virtual keyword to fix API mismatches.
14 * MatchCollection.cs: Removed virtual keyword to fix API mismatches.
15 * GroupCollection.cs: Removed virtual keyword to fix API mismatches.
17 2006-05-08 Raja R Harinath <rharinath@novell.com>
20 Remove 65535-limit on number of repetitions matched by a pattern.
21 We still have a 65535 limit on the length of a pattern and the
22 number of groups in a pattern.
23 * compiler.cs (PatternCompiler.EmitCount): New. Emits an int as
24 two ushorts into the program stream.
25 (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
27 * interpreter.cs (Intepreter.ReadProgramCount): Read an int
28 emitted into the program stream.
29 (Interpreter): Use it. Update counts.
30 (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
31 * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
32 and '+' repetition patterns.
33 * arch.cs (Info, Repeat, FastRepeat): Update description.
35 2006-04-18 Raja R Harinath <rharinath@novell.com>
37 Treat fixed repetitions of simple regexes as simple too.
38 * syntax.cs (Expression.IsComplex): Make abstract.
39 (Group.IsComplex, Alternation.IsComplex): Move ...
40 (CompositeExpression.IsComplex): ... here.
41 (Group.GetAnchorInfo): Reduce allocations. Avoid creating another
42 ArrayList, and use a StringBuilder to build up the string.
43 (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
44 (ExpressionAssertion.IsComplex): Override.
46 2006-04-17 Florian Gross <flgr@ccan.de>
47 Raja R Harinath <rharinath@novell.com>
49 * syntax.cs (CharacterClass.Compile): Emit categories after the
50 character intervals so that the evaluator can pick up the
53 2006-04-07 Raja R Harinath <rharinath@novell.com>
56 * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
57 Don't reset 'ptr' to 0 during forward scan.
60 * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
61 tail operation has a 'negate' flag, avoid the "match next char"
65 * arch.cs (OpCode.NotCategory): New. Stands for matching a
66 character _not_ from the given category.
67 * debug.cs (DisassembleBlock): Handle it.
68 * compiler.cs (ICompiler.EmitNotCategory): New.
69 (Compiler.EmitNotCategory): New. Emit OpCode.NotCategory.
70 * syntax.cs (CharacterClass.Compile): Don't conflate negation of
71 the character class and negation of the category. Use
73 * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
75 (Interpreter.EvalChar): Handle it.
77 2006-04-06 Raja R Harinath <rharinath@novell.com>
80 * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null
81 when evaluating the tail. Ensure that backtracks don't confuse
82 the recursion vs. iteration detector.
84 2006-04-03 Raja R Harinath <rharinath@novell.com>
86 * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a
89 2006-03-30 Raja R Harinath <harinath@gmail.com>
92 * parser.cs (Parser.ParseCharacterClass): Don't automatically
93 assume there's a range when we see '-'. Ensure that we have seen
94 at least one other character, and that we aren't already parsing a
95 range. Handle some more errors.
97 2005-12-19 Kornél Pál <kornelpal@hotmail.com>
99 * Regex.cs: Added support for regular expressions compiled to
100 assemblies by compiling the pattern. This solution ignores existing
101 CIL code but provides full support for regular expression classes
104 2005-11-21 Sebastien Pouliot <sebastien@ximian.com>
106 * CaptureCollection.cs: Fixed length check.
107 * Group.cs: Added missing validation for Synchronized method.
108 * Match.cs: Added missing validation for Synchronized and Result
110 * MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
111 * RegexCompilationInfo.cs: Added missing property validation.
112 * Regex.cs: Implemented UseOptionC and UseOptionR protected methods
113 (now documented). Fixed API for 2.0 profile.
114 * RegexRunner.cs: Stubbed CharInClass for 2.0 profile.
116 2005-11-17 Sebastien Pouliot <sebastien@ximian.com>
118 * Match.cs: Removed the ": base ()" on the private ctor as it is
119 unrequired and cause an extra public ctor to added (bug #76736).
120 * MatchCollection.cs: Add missing virtual to indexer property.
122 2005-09-23 Raja R Harinath <rharinath@novell.com>
124 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the
125 sense of a test to reflect the code re-organization.
127 2005-09-22 Raja R Harinath <rharinath@novell.com>
130 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
131 cases of recursion when dealing with eager quantifiers too. We
132 now avoid recursion when handling the innermost quantifier.
133 (Interpreter.IntStack, Interpreter.stack): New. Stack to help
134 implement backtracking in eager quantifiers.
136 2005-09-21 Raja R Harinath <rharinath@novell.com>
138 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
139 cases of recursion when dealing with the minimum count and lazy
142 2005-08-23 Raja R Harinath <rharinath@novell.com>
144 * regex.cs: Remove. Split into ...
145 * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs,
146 RegexOptions.cs: ... these. Now every publicly exposed type in
147 this namespace has its own file.
149 2005-07-21 Florian Gross <flgr@ccan.de>
151 * Fixed a bug in category.cs that caused ECMAScript \d to fail.
153 2005-07-13 Raja R Harinath <rharinath@novell.com>
155 Make even more lazier.
156 * MatchCollection.cs (TryToGet): Don't generate match i+1 when
157 we're looking for match i. Change post-conditions.
158 (FullList): New helper property. Ensures the list is fully populated.
159 (Count, CopyTo): Use it.
160 (Enumerator.Current): Update to new post-conditions of TryToGet.
161 (Enumerator.MoveNext): Likewise. Don't modify index if we're
164 2005-07-08 Raja R Harinath <rharinath@novell.com>
166 * MatchCollection.cs: Convert to incremental mode.
167 * regex.cs (Regex.Matches): Update. Pass responsibility of
168 generating all matches to MatchCollection.
170 2005-06-14 Raja R Harinath <harinath@gmail.com>
172 * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
175 * Match.cs (Match) [zero-argument variant]: Make private.
176 * GroupCollection (Item) [string variant]: Don't look for the
177 group number in an empty match.
179 2005-06-10 Raja R Harinath <rharinath@novell.com>
181 * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
182 intermediate arrays to build the final result.
183 (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
185 * CaptureCollection.cs (list): Change from ArrayList to list.
186 (SetValue): New internal helper, used by Interpreter.PopulateGroup.
187 (Enumerator): Remove helper class.
188 (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
189 * GroupCollection.cs: Likewise.
190 * Group.cs (Group): Move responsibility of populating 'Captures'
191 to Interpreter.PopulateGroup.
192 * Match.cs (Match): Move responsibility of populating 'Groups' to
193 Interpreter.GenerateMatch.
195 2005-05-25 Raja R Harinath <rharinath@novell.com>
197 * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
198 creating several intermediate strings. Simplify internal
199 intermediate representation.
200 (ReplacementEvaluator.EvaluateAppend): New. Version of Evaluate
201 that builds the result directly on a passed-in StringBuilder.
202 (ReplacementEvaluator.Evaluate): Just a wrapper around
204 * regex.cs (MatchAppendEvaluator): New internal delegate.
205 (Regex.Replace): Use MatchAppendEvaluator.
206 (Regex.Adapter): New class used to adapt a MatchEvaluator to a
207 MatchAppendEvaluator.
209 2005-05-24 Raja R Harinath <rharinath@novell.com>
211 * replace.cs (ReplacementEvaluator.CompileTerm): Fix group
214 2005-05-20 Ben Maurer <bmaurer@ximian.com>
216 * regex.cs: Some memory allocation optimizations.
218 2005-05-20 Raja R Harinath <rharinath@novell.com>
221 * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
222 fail and yet have advanced the pointer. Append the scanned-over
223 portion to the "literal" being built.
224 (ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
225 If a term cannot be recognized, just return null.
227 * compiler.cs (InterpreterFactory.GroupCount): Fix. The 0'th
228 index corresponds to Opcode.Info.
230 * parser.cs (Parser.Unescape): If the string doesn't contain any
231 '\' character, don't allocate a new string.
233 * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename
234 from GetResult. Append to a passed-in StringBuilder rather than
236 (ReplacementEvaluator.Evaluate): Update.
238 * Capture.cs, Group.cs, Match.cs: New files split out of ...
239 * match.cs: ... this. Remove.
241 2005-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
243 * parser.cs: stuff inside {} might not be a quantifier. Fixes
246 2005-01-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
248 * quicksearch.cs: handle IgnoreCase when getting the shift distance.
249 Fixes bug #69065. Patch by mei@work.email.ne.jp.
251 2005-01-08 Miguel de Icaza <miguel@ximian.com>
253 * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug
256 * parser.cs: Turns out that \digit sequences are octal sequences
257 (no leading zero is needed); And the three octal digit rule
258 applies to the leading zero as well.
260 This fixes the Unescape method.
262 2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
264 * regex.cs: use NextMatch to move on to the next match. Fixes bug
267 2004-11-09 Atsushi Enomoto <atsushi@ximian.com>
271 2004-11-08 Ben Maurer <bmaurer@ximian.com>
273 * replace.cs, parser.cs: Use stringbuilder for allocation sanity.
275 2004-10-21 Joerg Rosenkranz <joergr@voelcker.com>
277 * regex.cs: Fixed a bug introduced with the last patch which
278 prevented any replacements when a postive count is given.
279 This also happens in all overloads without count parameter.
281 2004-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
283 * regex.cs: in Replace, when count is negative, replacement continues
284 to the end of the string.
286 Fixes bug #68398. Patch by Jon Larimer.
288 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
290 * RegexRunner.cs: fixed case mismatch of methods
292 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
294 * RegexRunner.cs: marked TODO, added missing protected internal
295 fields, throw NotImplementedException in all methods
297 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
299 * RegexRunnerFactory.cs: removed comment, no longer throw exception
301 * regex.cs: fixed public API signature by renaming protected
302 internal fields and adding destructor, added MonoTODO attribute to
303 fields and method that are not yet implemented, changed not
304 implemented methods to throw NotImplementedException instead of
305 Exception, fixed names of field that are serialized
307 2004-06-06 Jambunathan K <kjambunathan@novell.com>
309 * parser.cs: Fixed issues with Regex.Unescape() identified as part of
310 debugging bug #58256. The original problem reported was about
311 inconsistency between the way we treat replacement patterns and the
312 way microsoft treats the replacement patterns in Regex.Replace(). MS
313 implementation is buggy and doesn't honour escape sequences in the
314 replacement patterns, even though the SDK claims otherwise.
317 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
319 * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
320 emitting a Category.All if both a category and its negated value are
323 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
325 * syntax.cs: reverting my previous patch. It causes bigger problems.
327 2004-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
329 * category.cs: added LastValue field to mark the end of enum Category.
330 * syntax.cs: in CharacterClass, use Category.LastValue to get the size
331 of the array needed. Use a BitArray instead of bool[].
332 In AddCategory(), don't set the opposite category as false. Fixes
333 bug #59150. All tests pass.
335 2004-05-25 Jackson Harper <jackson@ximian.com>
337 * parser.cs: Allow creating a regular expression using {,n} as the
338 specified. The min bounds is set to -1, I am not completely sure
339 if that is what it is supposed to be but MS does not set it to 0
340 based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761.
342 2004-05-12 Dick Porter <dick@ximian.com>
346 * RegexRunnerFactory.cs:
347 * RegexRunner.cs: More public API difference fixes.
349 * GroupCollection.cs:
350 * MatchCollection.cs:
351 * CaptureCollection.cs: Moved GroupCollection, MatchCollection and
352 CaptureCollection so that they no longer inherit from the
353 non-standard RegexCollectionBase class. Fixes the API difference.
355 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
362 Patch by Eric Durand Tremblay.
363 1) Capture inner group when named.
364 2) Resolved parse error caused by not capturing inner group
365 3) Resolved incorrect capture group
366 4) Now, not capturing anything when unnamed ( correct behavior)
369 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
375 * syntax.cs: converted to unix line endings.
377 2004-03-30 Lluis Sanchez Gual <lluis@ximian.com>
379 * collections.cs: In the indexer, return an empty group if the requested
381 * match.cs: Added default constructor for Group.
383 2004-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
385 * parser.cs: fixed group numbering.
387 2004-03-22 Jackson Harper <jackson@ximian.com>
389 * parser.cs: Use the group number as the name in mapping. Patch by
391 * regex.cs: Fix off by one error. Patch by Gert Driesen.
393 2004-03-17 Francois Beauchemin <beauche@softhome.net>
394 * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs :
395 Revised support for RigthToLeft.
396 quicksearch has now an reverse option.
397 This fixes bug #54537
399 * regex.cs, compiler.cs :
400 Some code to support CILCompiler.
402 Added some undocumented of MS.
404 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
406 * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797.
408 2004-02-01 Miguel de Icaza <miguel@ximian.com>
410 * syntax.cs, interval.cs: Applied patch from Marco Cravairo
411 through Francois Beauchemin who reviewed on the mailing list.
412 This fixes bug #45976
414 2004-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
416 * parser.cs: an opening brace without a
417 quantifier do not cause a parse error. Fixes bug #52924.
419 2004-01-07 Lluis Sanchez Gual <lluis@ximian.com>
421 * regex.cs: In Split(), if the last match is at the end of the string,
422 an empty string must be added to the array of results.
424 2003-12-15 Sanjay Gupta <gsanjay@novell.com>
425 * match.cs: Check for null value before Substring method call.
428 2003-11-21 Juraj Skripsky <js@hotfeet.ch>
430 * quicksearch.cs: Create and use hashtable only for "long" search
433 (Search): Use simple scan for a single-character search strings.
435 (GetChar): Simplify case sensitivity handling.
437 2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
439 * interpreter.cs: when evaluating a degenerate match, restore the
440 RepeatContext if fail. Fixes bug #42529.
442 2003-11-22 Jackson Harper <jackson@ximian.com>
444 * regex.cs: Add CultureInvariant flag to RegexOptions.
446 2003-11-20 Juraj Skripsky <js@hotfeet.ch>
448 * quicksearch.cs: Use a hashtable instead of an array for the
449 shift table to improve the memory usage.
451 2003-11-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
454 (Split): include capture groups in the results, if any. Fixes bug
457 2003-07-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
459 * regex.cs: patch from Eric Lindvall <eric@5stops.com> that fixes bug
462 2003-03-05 Miguel de Icaza <miguel@ximian.com>
464 * category.cs (CategoryUtils.CategoryFromName): Use StartsWith
465 ("Is") instead of a substring for (0,2) which was throwing an
466 exception causing Category.None to be returned
468 2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
470 * collections.cs: fixed bug #30091.
472 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
474 * regex.cs: fixed little mistake (closes #35860).
476 2002-11-12 Jackson Harper <jackson@latitudegeo.com>
478 * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories
480 2002-11-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
482 * parser.cs: detect illegal \ at end of pattern. Fixes 31334.
484 2002-10-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
486 * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to
487 solve bug #32807. Also modified GetMapping to return the same as MS.
489 2002-08-28 Juli Mallett <jmallett@FreeBSD.org>
491 * arch.cs, compiler.cs: Give the interpreter machine a property
492 for the retrieval of the group count.
494 * regex.cs: Use the new GroupCount property of the factory to
495 initialise the current group count, and restructure code to compile
496 the pattern only the first time it is needed (essentially backing
497 out the previous revision of regex.cs, to use the new code.)
499 2002-08-14 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
501 * regex.cs: Added the ctr for ISerializable implementation and
502 implemented the GetObjectData function.
504 2002-07-30 Juli Mallett <jmallett@FreeBSD.org>
506 * regex.cs: Fixed bug where the expression would not be
507 re-evaluated for grouping purposes when factory caches were
508 used, resulting in no groups being recognised after one call
509 with a given pattern and no change in options.
511 2002-05-13 Dan Lewis <dihlewis@yahoo.co.uk>
513 * regex.cs: Fixed bug in split.
515 2002-05-08 Dan Lewis <dihlewis@yahoo.co.uk>
517 * interpreter.cs: Moved to an array-based stack representation
520 * match.cs, collections.cs: Decoupled capture representation from
521 interpreter internals.
523 * cache.cs: Changed Key type from struct to class for speed.
525 2002-04-06 Dan Lewis <dihlewis@yahoo.co.uk>
527 * cache.cs: Object methods should be overridden with "override".
529 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
531 * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
532 added for completeness.
534 * regex.cs, match.cs, collections.cs: Serializable attribute.
536 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
538 * regex.cs: Added static Matches and IsMatch methods.
540 2002-04-03 Dan Lewis <dihlewis@yahoo.co.uk>
542 * ChangeLog: Added changelog.
544 * cache.cs: Fixed bug in MRUList.Evict.