1 2007-10-21 Gert Driesen <drieseng@users.sourceforge.net>
3 * RegexTest.cs: Removed. Test was already moved to the appropriate
6 2007-06-21 Juraj Skripsky <js@hotfeet.ch>
8 * quicksearch.ch: Optimization. Add byte array as skip table for
9 chars <= 255, falling back to the hashtable for chars > 255 and
12 2007-04-18 Raja R Harinath <rharinath@novell.com>
15 * parser.cs (ResolveReferences): Don't throw an expression if a
16 capture assertion reference cannot be resolved.
17 (ParseGroupingConstruct): Provide fallback expression to a capture
19 * syntax.cs (CaptureAssertion): If the bareword doesn't refer to
20 the name of a capture group, fallback to treating it as a literal
23 2007-04-04 Raja R Harinath <rharinath@novell.com>
25 * interpreter.cs (Eval) <OpCode.Reference>: Distribute for loop
27 for () if (a) s1; else s2; => if (a) for () s1; else for () s2;
29 2007-04-03 Raja R Harinath <rharinath@novell.com>
31 * Regex.cs (~Regex): Don't define in NET_2_0 profile.
33 2007-01-02 Raja R Harinath <rharinath@novell.com>
36 * parser.cs (Parser.GetMapping): Use the actual group numbers to
39 2006-09-28 Andrew Skiba <andrews@mainsoft.com>
41 * Regex.cs: TARGET_JVM
43 2006-05-30 Gert Driesen <drieseng@users.sourceforge.net>
45 * CaptureCollection.cs: Removed virtual keyword to fix API mismatches.
46 * MatchCollection.cs: Removed virtual keyword to fix API mismatches.
47 * GroupCollection.cs: Removed virtual keyword to fix API mismatches.
49 2006-05-08 Raja R Harinath <rharinath@novell.com>
52 Remove 65535-limit on number of repetitions matched by a pattern.
53 We still have a 65535 limit on the length of a pattern and the
54 number of groups in a pattern.
55 * compiler.cs (PatternCompiler.EmitCount): New. Emits an int as
56 two ushorts into the program stream.
57 (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
59 * interpreter.cs (Intepreter.ReadProgramCount): Read an int
60 emitted into the program stream.
61 (Interpreter): Use it. Update counts.
62 (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
63 * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
64 and '+' repetition patterns.
65 * arch.cs (Info, Repeat, FastRepeat): Update description.
67 2006-04-18 Raja R Harinath <rharinath@novell.com>
69 Treat fixed repetitions of simple regexes as simple too.
70 * syntax.cs (Expression.IsComplex): Make abstract.
71 (Group.IsComplex, Alternation.IsComplex): Move ...
72 (CompositeExpression.IsComplex): ... here.
73 (Group.GetAnchorInfo): Reduce allocations. Avoid creating another
74 ArrayList, and use a StringBuilder to build up the string.
75 (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
76 (ExpressionAssertion.IsComplex): Override.
78 2006-04-17 Florian Gross <flgr@ccan.de>
79 Raja R Harinath <rharinath@novell.com>
81 * syntax.cs (CharacterClass.Compile): Emit categories after the
82 character intervals so that the evaluator can pick up the
85 2006-04-07 Raja R Harinath <rharinath@novell.com>
88 * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
89 Don't reset 'ptr' to 0 during forward scan.
92 * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
93 tail operation has a 'negate' flag, avoid the "match next char"
97 * arch.cs (OpCode.NotCategory): New. Stands for matching a
98 character _not_ from the given category.
99 * debug.cs (DisassembleBlock): Handle it.
100 * compiler.cs (ICompiler.EmitNotCategory): New.
101 (Compiler.EmitNotCategory): New. Emit OpCode.NotCategory.
102 * syntax.cs (CharacterClass.Compile): Don't conflate negation of
103 the character class and negation of the category. Use
105 * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
107 (Interpreter.EvalChar): Handle it.
109 2006-04-06 Raja R Harinath <rharinath@novell.com>
112 * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null
113 when evaluating the tail. Ensure that backtracks don't confuse
114 the recursion vs. iteration detector.
116 2006-04-03 Raja R Harinath <rharinath@novell.com>
118 * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a
121 2006-03-30 Raja R Harinath <harinath@gmail.com>
124 * parser.cs (Parser.ParseCharacterClass): Don't automatically
125 assume there's a range when we see '-'. Ensure that we have seen
126 at least one other character, and that we aren't already parsing a
127 range. Handle some more errors.
129 2005-12-19 Kornél Pál <kornelpal@hotmail.com>
131 * Regex.cs: Added support for regular expressions compiled to
132 assemblies by compiling the pattern. This solution ignores existing
133 CIL code but provides full support for regular expression classes
136 2005-11-21 Sebastien Pouliot <sebastien@ximian.com>
138 * CaptureCollection.cs: Fixed length check.
139 * Group.cs: Added missing validation for Synchronized method.
140 * Match.cs: Added missing validation for Synchronized and Result
142 * MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
143 * RegexCompilationInfo.cs: Added missing property validation.
144 * Regex.cs: Implemented UseOptionC and UseOptionR protected methods
145 (now documented). Fixed API for 2.0 profile.
146 * RegexRunner.cs: Stubbed CharInClass for 2.0 profile.
148 2005-11-17 Sebastien Pouliot <sebastien@ximian.com>
150 * Match.cs: Removed the ": base ()" on the private ctor as it is
151 unrequired and cause an extra public ctor to added (bug #76736).
152 * MatchCollection.cs: Add missing virtual to indexer property.
154 2005-09-23 Raja R Harinath <rharinath@novell.com>
156 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the
157 sense of a test to reflect the code re-organization.
159 2005-09-22 Raja R Harinath <rharinath@novell.com>
162 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
163 cases of recursion when dealing with eager quantifiers too. We
164 now avoid recursion when handling the innermost quantifier.
165 (Interpreter.IntStack, Interpreter.stack): New. Stack to help
166 implement backtracking in eager quantifiers.
168 2005-09-21 Raja R Harinath <rharinath@novell.com>
170 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
171 cases of recursion when dealing with the minimum count and lazy
174 2005-08-23 Raja R Harinath <rharinath@novell.com>
176 * regex.cs: Remove. Split into ...
177 * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs,
178 RegexOptions.cs: ... these. Now every publicly exposed type in
179 this namespace has its own file.
181 2005-07-21 Florian Gross <flgr@ccan.de>
183 * Fixed a bug in category.cs that caused ECMAScript \d to fail.
185 2005-07-13 Raja R Harinath <rharinath@novell.com>
187 Make even more lazier.
188 * MatchCollection.cs (TryToGet): Don't generate match i+1 when
189 we're looking for match i. Change post-conditions.
190 (FullList): New helper property. Ensures the list is fully populated.
191 (Count, CopyTo): Use it.
192 (Enumerator.Current): Update to new post-conditions of TryToGet.
193 (Enumerator.MoveNext): Likewise. Don't modify index if we're
196 2005-07-08 Raja R Harinath <rharinath@novell.com>
198 * MatchCollection.cs: Convert to incremental mode.
199 * regex.cs (Regex.Matches): Update. Pass responsibility of
200 generating all matches to MatchCollection.
202 2005-06-14 Raja R Harinath <harinath@gmail.com>
204 * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
207 * Match.cs (Match) [zero-argument variant]: Make private.
208 * GroupCollection (Item) [string variant]: Don't look for the
209 group number in an empty match.
211 2005-06-10 Raja R Harinath <rharinath@novell.com>
213 * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
214 intermediate arrays to build the final result.
215 (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
217 * CaptureCollection.cs (list): Change from ArrayList to list.
218 (SetValue): New internal helper, used by Interpreter.PopulateGroup.
219 (Enumerator): Remove helper class.
220 (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
221 * GroupCollection.cs: Likewise.
222 * Group.cs (Group): Move responsibility of populating 'Captures'
223 to Interpreter.PopulateGroup.
224 * Match.cs (Match): Move responsibility of populating 'Groups' to
225 Interpreter.GenerateMatch.
227 2005-05-25 Raja R Harinath <rharinath@novell.com>
229 * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
230 creating several intermediate strings. Simplify internal
231 intermediate representation.
232 (ReplacementEvaluator.EvaluateAppend): New. Version of Evaluate
233 that builds the result directly on a passed-in StringBuilder.
234 (ReplacementEvaluator.Evaluate): Just a wrapper around
236 * regex.cs (MatchAppendEvaluator): New internal delegate.
237 (Regex.Replace): Use MatchAppendEvaluator.
238 (Regex.Adapter): New class used to adapt a MatchEvaluator to a
239 MatchAppendEvaluator.
241 2005-05-24 Raja R Harinath <rharinath@novell.com>
243 * replace.cs (ReplacementEvaluator.CompileTerm): Fix group
246 2005-05-20 Ben Maurer <bmaurer@ximian.com>
248 * regex.cs: Some memory allocation optimizations.
250 2005-05-20 Raja R Harinath <rharinath@novell.com>
253 * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
254 fail and yet have advanced the pointer. Append the scanned-over
255 portion to the "literal" being built.
256 (ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
257 If a term cannot be recognized, just return null.
259 * compiler.cs (InterpreterFactory.GroupCount): Fix. The 0'th
260 index corresponds to Opcode.Info.
262 * parser.cs (Parser.Unescape): If the string doesn't contain any
263 '\' character, don't allocate a new string.
265 * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename
266 from GetResult. Append to a passed-in StringBuilder rather than
268 (ReplacementEvaluator.Evaluate): Update.
270 * Capture.cs, Group.cs, Match.cs: New files split out of ...
271 * match.cs: ... this. Remove.
273 2005-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
275 * parser.cs: stuff inside {} might not be a quantifier. Fixes
278 2005-01-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
280 * quicksearch.cs: handle IgnoreCase when getting the shift distance.
281 Fixes bug #69065. Patch by mei@work.email.ne.jp.
283 2005-01-08 Miguel de Icaza <miguel@ximian.com>
285 * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug
288 * parser.cs: Turns out that \digit sequences are octal sequences
289 (no leading zero is needed); And the three octal digit rule
290 applies to the leading zero as well.
292 This fixes the Unescape method.
294 2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
296 * regex.cs: use NextMatch to move on to the next match. Fixes bug
299 2004-11-09 Atsushi Enomoto <atsushi@ximian.com>
303 2004-11-08 Ben Maurer <bmaurer@ximian.com>
305 * replace.cs, parser.cs: Use stringbuilder for allocation sanity.
307 2004-10-21 Joerg Rosenkranz <joergr@voelcker.com>
309 * regex.cs: Fixed a bug introduced with the last patch which
310 prevented any replacements when a postive count is given.
311 This also happens in all overloads without count parameter.
313 2004-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
315 * regex.cs: in Replace, when count is negative, replacement continues
316 to the end of the string.
318 Fixes bug #68398. Patch by Jon Larimer.
320 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
322 * RegexRunner.cs: fixed case mismatch of methods
324 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
326 * RegexRunner.cs: marked TODO, added missing protected internal
327 fields, throw NotImplementedException in all methods
329 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
331 * RegexRunnerFactory.cs: removed comment, no longer throw exception
333 * regex.cs: fixed public API signature by renaming protected
334 internal fields and adding destructor, added MonoTODO attribute to
335 fields and method that are not yet implemented, changed not
336 implemented methods to throw NotImplementedException instead of
337 Exception, fixed names of field that are serialized
339 2004-06-06 Jambunathan K <kjambunathan@novell.com>
341 * parser.cs: Fixed issues with Regex.Unescape() identified as part of
342 debugging bug #58256. The original problem reported was about
343 inconsistency between the way we treat replacement patterns and the
344 way microsoft treats the replacement patterns in Regex.Replace(). MS
345 implementation is buggy and doesn't honour escape sequences in the
346 replacement patterns, even though the SDK claims otherwise.
349 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
351 * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
352 emitting a Category.All if both a category and its negated value are
355 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
357 * syntax.cs: reverting my previous patch. It causes bigger problems.
359 2004-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
361 * category.cs: added LastValue field to mark the end of enum Category.
362 * syntax.cs: in CharacterClass, use Category.LastValue to get the size
363 of the array needed. Use a BitArray instead of bool[].
364 In AddCategory(), don't set the opposite category as false. Fixes
365 bug #59150. All tests pass.
367 2004-05-25 Jackson Harper <jackson@ximian.com>
369 * parser.cs: Allow creating a regular expression using {,n} as the
370 specified. The min bounds is set to -1, I am not completely sure
371 if that is what it is supposed to be but MS does not set it to 0
372 based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761.
374 2004-05-12 Dick Porter <dick@ximian.com>
378 * RegexRunnerFactory.cs:
379 * RegexRunner.cs: More public API difference fixes.
381 * GroupCollection.cs:
382 * MatchCollection.cs:
383 * CaptureCollection.cs: Moved GroupCollection, MatchCollection and
384 CaptureCollection so that they no longer inherit from the
385 non-standard RegexCollectionBase class. Fixes the API difference.
387 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
394 Patch by Eric Durand Tremblay.
395 1) Capture inner group when named.
396 2) Resolved parse error caused by not capturing inner group
397 3) Resolved incorrect capture group
398 4) Now, not capturing anything when unnamed ( correct behavior)
401 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
407 * syntax.cs: converted to unix line endings.
409 2004-03-30 Lluis Sanchez Gual <lluis@ximian.com>
411 * collections.cs: In the indexer, return an empty group if the requested
413 * match.cs: Added default constructor for Group.
415 2004-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
417 * parser.cs: fixed group numbering.
419 2004-03-22 Jackson Harper <jackson@ximian.com>
421 * parser.cs: Use the group number as the name in mapping. Patch by
423 * regex.cs: Fix off by one error. Patch by Gert Driesen.
425 2004-03-17 Francois Beauchemin <beauche@softhome.net>
426 * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs :
427 Revised support for RigthToLeft.
428 quicksearch has now an reverse option.
429 This fixes bug #54537
431 * regex.cs, compiler.cs :
432 Some code to support CILCompiler.
434 Added some undocumented of MS.
436 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
438 * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797.
440 2004-02-01 Miguel de Icaza <miguel@ximian.com>
442 * syntax.cs, interval.cs: Applied patch from Marco Cravairo
443 through Francois Beauchemin who reviewed on the mailing list.
444 This fixes bug #45976
446 2004-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
448 * parser.cs: an opening brace without a
449 quantifier do not cause a parse error. Fixes bug #52924.
451 2004-01-07 Lluis Sanchez Gual <lluis@ximian.com>
453 * regex.cs: In Split(), if the last match is at the end of the string,
454 an empty string must be added to the array of results.
456 2003-12-15 Sanjay Gupta <gsanjay@novell.com>
457 * match.cs: Check for null value before Substring method call.
460 2003-11-21 Juraj Skripsky <js@hotfeet.ch>
462 * quicksearch.cs: Create and use hashtable only for "long" search
465 (Search): Use simple scan for a single-character search strings.
467 (GetChar): Simplify case sensitivity handling.
469 2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
471 * interpreter.cs: when evaluating a degenerate match, restore the
472 RepeatContext if fail. Fixes bug #42529.
474 2003-11-22 Jackson Harper <jackson@ximian.com>
476 * regex.cs: Add CultureInvariant flag to RegexOptions.
478 2003-11-20 Juraj Skripsky <js@hotfeet.ch>
480 * quicksearch.cs: Use a hashtable instead of an array for the
481 shift table to improve the memory usage.
483 2003-11-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
486 (Split): include capture groups in the results, if any. Fixes bug
489 2003-07-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
491 * regex.cs: patch from Eric Lindvall <eric@5stops.com> that fixes bug
494 2003-03-05 Miguel de Icaza <miguel@ximian.com>
496 * category.cs (CategoryUtils.CategoryFromName): Use StartsWith
497 ("Is") instead of a substring for (0,2) which was throwing an
498 exception causing Category.None to be returned
500 2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
502 * collections.cs: fixed bug #30091.
504 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
506 * regex.cs: fixed little mistake (closes #35860).
508 2002-11-12 Jackson Harper <jackson@latitudegeo.com>
510 * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories
512 2002-11-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
514 * parser.cs: detect illegal \ at end of pattern. Fixes 31334.
516 2002-10-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
518 * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to
519 solve bug #32807. Also modified GetMapping to return the same as MS.
521 2002-08-28 Juli Mallett <jmallett@FreeBSD.org>
523 * arch.cs, compiler.cs: Give the interpreter machine a property
524 for the retrieval of the group count.
526 * regex.cs: Use the new GroupCount property of the factory to
527 initialise the current group count, and restructure code to compile
528 the pattern only the first time it is needed (essentially backing
529 out the previous revision of regex.cs, to use the new code.)
531 2002-08-14 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
533 * regex.cs: Added the ctr for ISerializable implementation and
534 implemented the GetObjectData function.
536 2002-07-30 Juli Mallett <jmallett@FreeBSD.org>
538 * regex.cs: Fixed bug where the expression would not be
539 re-evaluated for grouping purposes when factory caches were
540 used, resulting in no groups being recognised after one call
541 with a given pattern and no change in options.
543 2002-05-13 Dan Lewis <dihlewis@yahoo.co.uk>
545 * regex.cs: Fixed bug in split.
547 2002-05-08 Dan Lewis <dihlewis@yahoo.co.uk>
549 * interpreter.cs: Moved to an array-based stack representation
552 * match.cs, collections.cs: Decoupled capture representation from
553 interpreter internals.
555 * cache.cs: Changed Key type from struct to class for speed.
557 2002-04-06 Dan Lewis <dihlewis@yahoo.co.uk>
559 * cache.cs: Object methods should be overridden with "override".
561 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
563 * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
564 added for completeness.
566 * regex.cs, match.cs, collections.cs: Serializable attribute.
568 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
570 * regex.cs: Added static Matches and IsMatch methods.
572 2002-04-03 Dan Lewis <dihlewis@yahoo.co.uk>
574 * ChangeLog: Added changelog.
576 * cache.cs: Fixed bug in MRUList.Evict.