1 2010-02-03 Rodrigo Kumpera <rkumpera@novell.com>
3 * BaseMachine.cs (Split): Don't add empty strings if they don't come from
4 the first capture group. Fixes #566117.
6 2010-01-12 Miguel de Icaza <miguel@novell.com>
8 * Regex.cs: Re-enable the new regex compiler as the bug seems to
11 2009-09-07 Raja R Harinath <harinath@hurrynot.org>
13 * Regex.cs (Escape, Unescape): Add null checks.
14 (validate_options): Add ECMAScript option checks.
15 (Replace, Split): Add a few bounds checks.
17 2009-09-07 Raja R Harinath <harinath@hurrynot.org>
19 Add some null checks and bounds checks.
20 * Regex.cs (default_startat): New. Replaces the fragment
21 'RightToLeft ? input.Length : 0' with a null-safe variant.
22 (Replace) <string variant>: Add null checks for argument strings.
24 (.ctor): Likewise. Validate regex options partially.
25 (Match): Add null check on string arguments, and bounds checks for
26 offset and length arguments.
28 2009-08-20 Raja R Harinath <harinath@hurrynot.org>
30 Final piece of explicit numeric group support
31 * parser.cs (gap): New.
32 (GetMapping): Return it.
33 (ResolveReferences): Collect explicit numeric groups which may not
35 (HandleExplicitNumericGroups): New. Process the above list to
36 assign appropriate indices, and compute the correct value of 'gap'.
38 2009-08-20 Raja R Harinath <harinath@hurrynot.org>
40 * syntax.cs (CapturingGroup.Index): Rename from Number to clarify
42 (CapturingGroup.CompareTo): New.
43 * parser.cs, syntax.cs: Update to changes.
45 2009-08-20 Raja R Harinath <harinath@hurrynot.org>
47 Implement some more group number/index distinction
48 * Regex.cs (gap, Gap): New.
49 (Init, InitNewRegex): Update it.
50 (GroupNumberFromName): If the 'name' is beyond the gap, it is an
51 explicit numeric group -- use the name as the group number.
52 (GetGroupIndex): Use a binary search to map a group number to its
53 index when we know that they don't match.
54 (GroupNumbers): Use group number, not group index, for explicit
56 * Match.cs (.ctor): Use the newly introduce 'Regex.Gap'.
58 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
60 * Regex.cs (group_numbers): New.
61 (GetGroupNumbers): Move array initialization ...
62 (GroupNumbers): ... to new on-demand initializer.
64 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
66 * Regex.cs (group_names): Rename from _groupNumbersToNameMap.
67 (GetGroupNamesArray): Use an IDictionaryEnumerator to walk the
68 mapping, since both the key and value are used in the loop.
70 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
72 Introduce 'gap' concept into all the variants of regex
73 * arch.cs (IMachineFactory::Gap): New property.
74 * compiler.cs (InterpreterFactory): Update to changes.
75 * RxCompiler.cs (RxInterpreterFactory): Likewise.
76 * JvmReMachineFactory.cs: Likewise.
77 * parser.cs (GetMapping): Return the 'gap' index. Move creation
78 of mapping dictionary ...
79 * Regex.cs (CreateMachineFactory): ... here. Update to changes.
81 2009-08-18 Raja R Harinath <harinath@hurrynot.org>
83 Distinguish between the internal index of a group and group number.
84 * Regex.cs (GetGroupIndex): New.
85 (GroupNameFromNumber): Use it.
86 * GroupCollection.cs (.ctor): Introduce 'gap' argument. It is the
87 index of the first group whose group number differs from its index.
90 2009-08-18 Raja R Harinath <harinath@hurrynot.org>
92 * parser.cs (GetMapping): Extend duplicate check for numeric
95 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
97 * parser.cs (ResolveReferences): Handle some cases of
98 explicitly-named numeric groups.
100 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
102 * parser.cs (ResolveReferences): Rearrange slightly to prepare for
105 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
107 * Regex.cs (GetGroupNumbers): List group numbers in ascending order.
108 (GetGroupNames): List names in order of group number.
110 2009-08-12 Raja R Harinath <harinath@hurrynot.org>
112 * syntax.cs (BackslashNumber.ResolveReference): Improve ECMAScript
113 semantics. Handle cases like "group 43 exists but group 4 doesn't".
115 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
117 * syntax.cs (BackslashNumber.ResolveReference): Implement fallback
118 to octal numbers, and ECMAScript semantics.
119 * parser.cs (ResolveReferences): Use it.
121 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
123 * syntax.cs (BackslashNumber): New class.
124 * parser.cs (ParseSpecial): Create it instead of 'Reference' if a
125 numeric backreference is seen.
127 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
129 * parser.cs (ResolveReferences): Allow named groups to be
130 referred-to by their group numbers too.
132 2009-04-23 Sebastien Pouliot <sebastien@ximian.com>
134 * Regex.cs: Remove Compiler-related support for NET_2_1
135 * RegexOptions.cs: Remove Compile from values available on NET_2_1
137 2009-03-04 Zoltan Varga <vargaz@gmail.com>
139 * RxInterpreter.cs (ResetGroups): Avoid allocating larger than needed
142 2009-02-27 Jonathan Pryor <jpryor@novell.com>
144 * Regex.cs (Replace): Check that input & evaluator are not null, as
145 documented in MSDN (and the variance found while testing DbLinq).
147 2009-02-27 Zoltan Varga <vargaz@gmail.com>
149 * BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an
150 appropriate initial length.
152 2009-02-24 Zoltan Varga <vargaz@gmail.com>
154 * CILCompiler.cs: Partially inline calls to Char.ToLower () to speed
155 up ignorecase matching.
157 2009-02-16 Jb Evain <jbevain@novell.com>
159 * Regex.cs: on the NET_2_1 profile, always use the old engine for now.
161 2009-02-14 Zoltan Varga <vargaz@gmail.com>
163 * Regex.cs: Add a MONO_NEW_RX variable to enable the new regex
166 2009-02-04 Zoltan Varga <vargaz@gmail.com>
168 * Regex.cs: Disable the new regex engine for now.
170 2009-01-14 Zoltan Varga <vargaz@gmail.com>
172 * CILCompiler.cs: Avoid throwing exceptions for a few more unhandled opcodes.
173 Implement the reverse/ignorecase versions of Reference. Fix the reverse
174 version of Bitmap. Error out if a Jump opcode jumps outside the current
175 pc range. This works around #466151.
177 2009-01-12 Jb Evain <jbevain@novell.com>
179 * RxInterpreter.cs: set trace_rx to false for NET_2_1.
180 * Regex.cs: set old_rx to false for NET_2_1.
182 2009-01-07 Zoltan Varga <vargaz@gmail.com>
184 * RxInterpreter.cs: Add support for constant strings in anchors. Fixes
187 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
189 * cache.cs: avoid infinite loop.
191 2008-11-14 Gonzalo Paniagua Javier <gonzalo@novell.com>
194 * Regex.cs: honor CacheSize value.
196 2008-11-13 Zoltan Varga <vargaz@gmail.com>
198 * RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841.
200 2008-11-11 Zoltan Varga <vargaz@gmail.com>
202 * CILCompiler.cs: Implement Reference opcode.
204 2008-10-30 Zoltan Varga <vargaz@gmail.com>
206 * CILCompiler.cs: Implement SubExpression opcode.
208 * CILCompiler.cs: Save and restore strpos in the Test opcode. Fixes
211 2008-10-25 Zoltan Varga <vargaz@gmail.com>
213 * CILCompiler.cs: Implement Test opcode.
215 2008-10-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
217 * RxInterpreter.cs: implement missing Unicode* opcodes and
218 StringReverseIgnoreCase.
220 2008-10-25 Zoltan Varga <vargaz@gmail.com>
222 * RxOp.cs: Remove unused Generic opcodes.
224 * RxCompiler.cs: Emit opcodes with flags using methods which can be
225 overriden by CILCompiler.cs, so we only have to override a few methods.
227 * CILCompiler.cs: Simplify based on the RxCompiler changes. Implement
228 UnicodeString opcode. Throw a NotImplementedException when an unsupported
229 opcode is encountered, since the IL compiler is now believed to be feature
232 2008-10-24 Zoltan Varga <vargaz@gmail.com>
234 * RxInterpreter.cs CILCompiler.cs gen-interp.cs: Fix the reading of short
235 values from the instruction stream.
237 * RxOp.cs: Add some missing unicode opcodes.
239 * gen-interp.cs RxInterpreter.cs: Generate Bitmap/UnicodeBitmap opcodes too.
241 * CILCompiler.cs (EmitEvalMethodBody): Add an 'end_pc' argument to mark the
242 end of the bytecode range which needs to be compiled. Use it to avoid
243 compiling the same bytecode multiple times in various opcodes. Fix
244 RxOp.Jump implementation. Add implementation for unicode opcodes.
246 2008-10-09 Zoltan Varga <vargaz@gmail.com>
248 * CILCompiler.cs: Implement NoBitmap/NoBitmapIgnoreCase. Fixes #432172.
250 2008-09-14 Zoltan Varga <vargaz@gmail.com>
252 * gen-interp.cs: New file to generate the all variants of the character
253 checking opcodes in RxInterpreter.cs.
255 * RxInterpreter.cs: Replace hand written code with code generated by
258 * RxInterpreter.cs: Fix the failure case of the No<XXX> opcodes. Fixes
261 2008-09-13 Zoltan Varga <vargaz@gmail.com>
263 * RxInterpreter.cs RxCompiler.cs: Implement some missing Category opcodes.
265 2008-09-07 Zoltan Varga <vargaz@gmail.com>
267 * CILCompiler.cs: Override ICompiler.EmitSet too so we set op_flags for
268 Bitmap opcodes too. Fixes #424073.
270 2008-09-06 Zoltan Varga <vargaz@gmail.com>
272 * Regex.cs: Make the new regex interpreter+compiler the default.
274 2008-08-31 Zoltan Varga <vargaz@gmail.com>
276 * RxInterpreter.cs: Port the Anchor+StartOfString optimization from the old
277 interpreter. Add credits.
279 * RxCompiler.cs (EmitString): Lowercase the string if ignore is true.
281 * CILCompiler.cs: Fix the setting of the match position in the
282 anchor+char optimization.
284 * CILCompiler.cs: Implement FastRepeatLazy.
286 * CILCompiler.cs: Get rid of commented out code. Also get rid of
287 frame.local_strpos_res, since the generated code already set Arg1 to
290 2008-08-30 Zoltan Varga <vargaz@gmail.com>
292 * CILCompiler.cs: Initialize all mi_ variables lazily.
294 * CILCompiler.cs: Implement FastRepeat.
296 * RxInterpreter.cs: Add back SetStartOfMatch, make it protected so as to
299 * CILCompiler.cs RxOp.cs: Merge lots of changes from RxInterpreter.cs,
302 2008-08-29 Zoltan Varga <vargaz@gmail.com>
304 * RxInterpreter.cs RxCompiler.cs RxOp.cs: Implement/fix this so all the
305 regex tests now run. The Repeat code is taken from the old interpreter.
307 2008-08-28 Zoltan Varga <vargaz@gmail.com>
309 * RxInterpreter.cs RxCompiler.cs RxOp.cs: Add support for
310 Category.AnySingleline.
312 2008-08-27 Zoltan Varga <vargaz@gmail.com>
314 * RxCompiler.cs: Use Array.Copy since Buffer.BlockCopy operates on bytes.
316 2008-07-31 Jb Evain <jbevain@novell.com>
318 * BaseMachine.cs: clean up for NET_2_1.
320 2008-06-05 Roei Erez <roeie@mainsoft.com>
322 * JvmReMachine.jvm.cs: Fix a bug in match that contains
323 empty group at the end.
325 2008-04-13 Jb Evain <jbevain@novell.com>
327 * Regex.cs: update undocumented fields for the 2.1 profile.
328 Merged from the Moonlight 2 branch.
330 2008-02-26 Zoltan Varga <vargaz@gmail.com>
332 * CILCompiler.cs: Implement StringIgnoreCase.
334 * CILCompiler.cs: Implement grouping support.
336 * CILCompiler.cs: Implement character groups.
338 2008-02-25 Zoltan Varga <vargaz@gmail.com>
340 * CILCompiler.cs: Implement lots of missing opcodes.
342 2008-02-18 Zoltan Varga <vargaz@gmail.com>
344 * CILCompiler.cs (EmitEvalMethodBody): Check for the not-yet supported
347 Thu Feb 14 19:03:00 CET 2008 Paolo Molaro <lupus@ximian.com>
349 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs, CILCompiler.cs : support for word
350 boundary position opcodes, ignorecase backreference and more capture
353 Thu Feb 14 17:11:10 CET 2008 Paolo Molaro <lupus@ximian.com>
355 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: replace EcmaDigit with
356 Range, fixed matching of "" =~ /$/, implementedt TestCharGroup.
357 Fixes and other misc opcodes implemented.
359 2008-02-13 Zoltan Varga <vargaz@gmail.com>
361 * CILCompiler.cs: Restructure some code to avoid a branch inside a loop.
363 * CILCompiler.cs: Fix the unsafe string matching code.
365 * CILCompiler.cs: Improved version which emits only one method in most cases.
367 * CILCompiler.cs: Fix some comments.
369 * CILCompiler.cs: New file, extracted from RxCompiler.cs.
371 * RxInterpreter.cs RxCompiler.cs: First version of regex IL compiler.
373 Wed Feb 13 13:18:12 CET 2008 Paolo Molaro <lupus@ximian.com>
375 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: unicode categories and
376 some grouping/capture support.
378 Tue Feb 12 19:16:49 CET 2008 Paolo Molaro <lupus@ximian.com>
380 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: experimental new
383 2008-02-10 Zoltan Varga <vargaz@gmail.com>
385 * replace.cs (NeedsGroupsOrCaptures): New property. Determines whenever the
386 replacement process needs access to the groups or captures properties of the
389 * Group.cs: Add an internal ctor which avoids allocations.
393 * BaseMachine.cs interpreter.cs: Add an optimization to avoid fully creating
394 Match objects during Replace () if the replacement string is simple.
396 * BaseMachine.cs Regex.cs: Make LTRReplace and RTLReplace instance methods to
397 avoid creating two machines for each Regex.Replace () call.
399 * interpreter.cs (Eval): Remove a needless string allocation.
401 2007-12-04 Arina Itkes <arinai@mainsoft.com>
403 * parser.cs: Max value of m for a construct {n,m} is 2147483647.
405 2007-11-15 Miguel de Icaza <miguel@novell.com>
407 * Revert the patch from Juraj Skripsky as it made the class
408 non-thread safe (see #341986).
410 2007-11-08 Raja R Harinath <harinath@gmail.com>
413 * BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr'
414 to deduce absence of matches -- a match can have length 0.
415 (RTLReplace): Likewise.
417 2007-11-07 Raja R Harinath <harinath@gmail.com>
419 Support RegexOptions.RightToLeft in Replace().
420 * BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace
422 (LTRReplace): Make internal and rename the MatchAppendEvaluator
423 version of Replace to this.
425 * Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine.
426 * replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case.
427 Based on patch by Stephane Delcroix.
429 * replace.cs (Compile): Don't unescape string.
431 2007-11-01 Gert Driesen <drieseng@users.sourceforge.net>
433 * Match.cs: Do not throw NotSupportedException on zero-length
434 replacement argument.
436 2007-10-29 Arina Itkes <arinai@mainsoft.com>
438 * Regex.cs: Moving creation of Regex machine to ctor.
439 It increases an initialization time of Regex but reduce a
440 process time while APIs calling. Also it solves the problem
441 of missed multi thread synchronization.
443 2007-10-29 Arina Itkes <arinai@mainsoft.com>
445 * Match.cs: Fix for Result method of Match. Throwing an exception
446 if Result method was called on a failed Match.
448 2007-10-24 Juraj Skripsky <js@hotfeet.ch>
450 * Regex.cs: Store and re-use IMachine, no need to re-instantiate
451 it every time we're matching.
453 2007-10-24 Arina Itkes <arinai@mainsoft.com>
455 * Regex.cs Match.cs arch.cs compiler.cs interpreter.cs
456 Refactoring of Interpreter with extracting of base abstract class
457 that executes some methods that were moved from Regex and Match classes.
458 Added a field that maps group numbers to group names in Regex for
459 improvement of performance of GroupNameFromNumber method.
461 2007-10-21 Gert Driesen <drieseng@users.sourceforge.net>
463 * RegexTest.cs: Removed. Test was already moved to the appropriate
466 2007-06-21 Juraj Skripsky <js@hotfeet.ch>
468 * quicksearch.ch: Optimization. Add byte array as skip table for
469 chars <= 255, falling back to the hashtable for chars > 255 and
470 skip distances > 255.
472 2007-04-18 Raja R Harinath <rharinath@novell.com>
475 * parser.cs (ResolveReferences): Don't throw an expression if a
476 capture assertion reference cannot be resolved.
477 (ParseGroupingConstruct): Provide fallback expression to a capture
479 * syntax.cs (CaptureAssertion): If the bareword doesn't refer to
480 the name of a capture group, fallback to treating it as a literal
483 2007-04-04 Raja R Harinath <rharinath@novell.com>
485 * interpreter.cs (Eval) <OpCode.Reference>: Distribute for loop
487 for () if (a) s1; else s2; => if (a) for () s1; else for () s2;
489 2007-04-03 Raja R Harinath <rharinath@novell.com>
491 * Regex.cs (~Regex): Don't define in NET_2_0 profile.
493 2007-01-02 Raja R Harinath <rharinath@novell.com>
496 * parser.cs (Parser.GetMapping): Use the actual group numbers to
499 2006-09-28 Andrew Skiba <andrews@mainsoft.com>
501 * Regex.cs: TARGET_JVM
503 2006-05-30 Gert Driesen <drieseng@users.sourceforge.net>
505 * CaptureCollection.cs: Removed virtual keyword to fix API mismatches.
506 * MatchCollection.cs: Removed virtual keyword to fix API mismatches.
507 * GroupCollection.cs: Removed virtual keyword to fix API mismatches.
509 2006-05-08 Raja R Harinath <rharinath@novell.com>
512 Remove 65535-limit on number of repetitions matched by a pattern.
513 We still have a 65535 limit on the length of a pattern and the
514 number of groups in a pattern.
515 * compiler.cs (PatternCompiler.EmitCount): New. Emits an int as
516 two ushorts into the program stream.
517 (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
519 * interpreter.cs (Intepreter.ReadProgramCount): Read an int
520 emitted into the program stream.
521 (Interpreter): Use it. Update counts.
522 (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
523 * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
524 and '+' repetition patterns.
525 * arch.cs (Info, Repeat, FastRepeat): Update description.
527 2006-04-18 Raja R Harinath <rharinath@novell.com>
529 Treat fixed repetitions of simple regexes as simple too.
530 * syntax.cs (Expression.IsComplex): Make abstract.
531 (Group.IsComplex, Alternation.IsComplex): Move ...
532 (CompositeExpression.IsComplex): ... here.
533 (Group.GetAnchorInfo): Reduce allocations. Avoid creating another
534 ArrayList, and use a StringBuilder to build up the string.
535 (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
536 (ExpressionAssertion.IsComplex): Override.
538 2006-04-17 Florian Gross <flgr@ccan.de>
539 Raja R Harinath <rharinath@novell.com>
541 * syntax.cs (CharacterClass.Compile): Emit categories after the
542 character intervals so that the evaluator can pick up the
545 2006-04-07 Raja R Harinath <rharinath@novell.com>
548 * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
549 Don't reset 'ptr' to 0 during forward scan.
552 * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
553 tail operation has a 'negate' flag, avoid the "match next char"
557 * arch.cs (OpCode.NotCategory): New. Stands for matching a
558 character _not_ from the given category.
559 * debug.cs (DisassembleBlock): Handle it.
560 * compiler.cs (ICompiler.EmitNotCategory): New.
561 (Compiler.EmitNotCategory): New. Emit OpCode.NotCategory.
562 * syntax.cs (CharacterClass.Compile): Don't conflate negation of
563 the character class and negation of the category. Use
565 * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
567 (Interpreter.EvalChar): Handle it.
569 2006-04-06 Raja R Harinath <rharinath@novell.com>
572 * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null
573 when evaluating the tail. Ensure that backtracks don't confuse
574 the recursion vs. iteration detector.
576 2006-04-03 Raja R Harinath <rharinath@novell.com>
578 * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a
581 2006-03-30 Raja R Harinath <harinath@gmail.com>
584 * parser.cs (Parser.ParseCharacterClass): Don't automatically
585 assume there's a range when we see '-'. Ensure that we have seen
586 at least one other character, and that we aren't already parsing a
587 range. Handle some more errors.
589 2005-12-19 Kornél Pál <kornelpal@hotmail.com>
591 * Regex.cs: Added support for regular expressions compiled to
592 assemblies by compiling the pattern. This solution ignores existing
593 CIL code but provides full support for regular expression classes
596 2005-11-21 Sebastien Pouliot <sebastien@ximian.com>
598 * CaptureCollection.cs: Fixed length check.
599 * Group.cs: Added missing validation for Synchronized method.
600 * Match.cs: Added missing validation for Synchronized and Result
602 * MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
603 * RegexCompilationInfo.cs: Added missing property validation.
604 * Regex.cs: Implemented UseOptionC and UseOptionR protected methods
605 (now documented). Fixed API for 2.0 profile.
606 * RegexRunner.cs: Stubbed CharInClass for 2.0 profile.
608 2005-11-17 Sebastien Pouliot <sebastien@ximian.com>
610 * Match.cs: Removed the ": base ()" on the private ctor as it is
611 unrequired and cause an extra public ctor to added (bug #76736).
612 * MatchCollection.cs: Add missing virtual to indexer property.
614 2005-09-23 Raja R Harinath <rharinath@novell.com>
616 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the
617 sense of a test to reflect the code re-organization.
619 2005-09-22 Raja R Harinath <rharinath@novell.com>
622 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
623 cases of recursion when dealing with eager quantifiers too. We
624 now avoid recursion when handling the innermost quantifier.
625 (Interpreter.IntStack, Interpreter.stack): New. Stack to help
626 implement backtracking in eager quantifiers.
628 2005-09-21 Raja R Harinath <rharinath@novell.com>
630 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
631 cases of recursion when dealing with the minimum count and lazy
634 2005-08-23 Raja R Harinath <rharinath@novell.com>
636 * regex.cs: Remove. Split into ...
637 * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs,
638 RegexOptions.cs: ... these. Now every publicly exposed type in
639 this namespace has its own file.
641 2005-07-21 Florian Gross <flgr@ccan.de>
643 * Fixed a bug in category.cs that caused ECMAScript \d to fail.
645 2005-07-13 Raja R Harinath <rharinath@novell.com>
647 Make even more lazier.
648 * MatchCollection.cs (TryToGet): Don't generate match i+1 when
649 we're looking for match i. Change post-conditions.
650 (FullList): New helper property. Ensures the list is fully populated.
651 (Count, CopyTo): Use it.
652 (Enumerator.Current): Update to new post-conditions of TryToGet.
653 (Enumerator.MoveNext): Likewise. Don't modify index if we're
656 2005-07-08 Raja R Harinath <rharinath@novell.com>
658 * MatchCollection.cs: Convert to incremental mode.
659 * regex.cs (Regex.Matches): Update. Pass responsibility of
660 generating all matches to MatchCollection.
662 2005-06-14 Raja R Harinath <harinath@gmail.com>
664 * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
667 * Match.cs (Match) [zero-argument variant]: Make private.
668 * GroupCollection (Item) [string variant]: Don't look for the
669 group number in an empty match.
671 2005-06-10 Raja R Harinath <rharinath@novell.com>
673 * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
674 intermediate arrays to build the final result.
675 (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
677 * CaptureCollection.cs (list): Change from ArrayList to list.
678 (SetValue): New internal helper, used by Interpreter.PopulateGroup.
679 (Enumerator): Remove helper class.
680 (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
681 * GroupCollection.cs: Likewise.
682 * Group.cs (Group): Move responsibility of populating 'Captures'
683 to Interpreter.PopulateGroup.
684 * Match.cs (Match): Move responsibility of populating 'Groups' to
685 Interpreter.GenerateMatch.
687 2005-05-25 Raja R Harinath <rharinath@novell.com>
689 * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
690 creating several intermediate strings. Simplify internal
691 intermediate representation.
692 (ReplacementEvaluator.EvaluateAppend): New. Version of Evaluate
693 that builds the result directly on a passed-in StringBuilder.
694 (ReplacementEvaluator.Evaluate): Just a wrapper around
696 * regex.cs (MatchAppendEvaluator): New internal delegate.
697 (Regex.Replace): Use MatchAppendEvaluator.
698 (Regex.Adapter): New class used to adapt a MatchEvaluator to a
699 MatchAppendEvaluator.
701 2005-05-24 Raja R Harinath <rharinath@novell.com>
703 * replace.cs (ReplacementEvaluator.CompileTerm): Fix group
706 2005-05-20 Ben Maurer <bmaurer@ximian.com>
708 * regex.cs: Some memory allocation optimizations.
710 2005-05-20 Raja R Harinath <rharinath@novell.com>
713 * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
714 fail and yet have advanced the pointer. Append the scanned-over
715 portion to the "literal" being built.
716 (ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
717 If a term cannot be recognized, just return null.
719 * compiler.cs (InterpreterFactory.GroupCount): Fix. The 0'th
720 index corresponds to Opcode.Info.
722 * parser.cs (Parser.Unescape): If the string doesn't contain any
723 '\' character, don't allocate a new string.
725 * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename
726 from GetResult. Append to a passed-in StringBuilder rather than
728 (ReplacementEvaluator.Evaluate): Update.
730 * Capture.cs, Group.cs, Match.cs: New files split out of ...
731 * match.cs: ... this. Remove.
733 2005-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
735 * parser.cs: stuff inside {} might not be a quantifier. Fixes
738 2005-01-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
740 * quicksearch.cs: handle IgnoreCase when getting the shift distance.
741 Fixes bug #69065. Patch by mei@work.email.ne.jp.
743 2005-01-08 Miguel de Icaza <miguel@ximian.com>
745 * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug
748 * parser.cs: Turns out that \digit sequences are octal sequences
749 (no leading zero is needed); And the three octal digit rule
750 applies to the leading zero as well.
752 This fixes the Unescape method.
754 2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
756 * regex.cs: use NextMatch to move on to the next match. Fixes bug
759 2004-11-09 Atsushi Enomoto <atsushi@ximian.com>
763 2004-11-08 Ben Maurer <bmaurer@ximian.com>
765 * replace.cs, parser.cs: Use stringbuilder for allocation sanity.
767 2004-10-21 Joerg Rosenkranz <joergr@voelcker.com>
769 * regex.cs: Fixed a bug introduced with the last patch which
770 prevented any replacements when a postive count is given.
771 This also happens in all overloads without count parameter.
773 2004-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
775 * regex.cs: in Replace, when count is negative, replacement continues
776 to the end of the string.
778 Fixes bug #68398. Patch by Jon Larimer.
780 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
782 * RegexRunner.cs: fixed case mismatch of methods
784 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
786 * RegexRunner.cs: marked TODO, added missing protected internal
787 fields, throw NotImplementedException in all methods
789 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
791 * RegexRunnerFactory.cs: removed comment, no longer throw exception
793 * regex.cs: fixed public API signature by renaming protected
794 internal fields and adding destructor, added MonoTODO attribute to
795 fields and method that are not yet implemented, changed not
796 implemented methods to throw NotImplementedException instead of
797 Exception, fixed names of field that are serialized
799 2004-06-06 Jambunathan K <kjambunathan@novell.com>
801 * parser.cs: Fixed issues with Regex.Unescape() identified as part of
802 debugging bug #58256. The original problem reported was about
803 inconsistency between the way we treat replacement patterns and the
804 way microsoft treats the replacement patterns in Regex.Replace(). MS
805 implementation is buggy and doesn't honour escape sequences in the
806 replacement patterns, even though the SDK claims otherwise.
809 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
811 * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
812 emitting a Category.All if both a category and its negated value are
815 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
817 * syntax.cs: reverting my previous patch. It causes bigger problems.
819 2004-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
821 * category.cs: added LastValue field to mark the end of enum Category.
822 * syntax.cs: in CharacterClass, use Category.LastValue to get the size
823 of the array needed. Use a BitArray instead of bool[].
824 In AddCategory(), don't set the opposite category as false. Fixes
825 bug #59150. All tests pass.
827 2004-05-25 Jackson Harper <jackson@ximian.com>
829 * parser.cs: Allow creating a regular expression using {,n} as the
830 specified. The min bounds is set to -1, I am not completely sure
831 if that is what it is supposed to be but MS does not set it to 0
832 based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761.
834 2004-05-12 Dick Porter <dick@ximian.com>
838 * RegexRunnerFactory.cs:
839 * RegexRunner.cs: More public API difference fixes.
841 * GroupCollection.cs:
842 * MatchCollection.cs:
843 * CaptureCollection.cs: Moved GroupCollection, MatchCollection and
844 CaptureCollection so that they no longer inherit from the
845 non-standard RegexCollectionBase class. Fixes the API difference.
847 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
854 Patch by Eric Durand Tremblay.
855 1) Capture inner group when named.
856 2) Resolved parse error caused by not capturing inner group
857 3) Resolved incorrect capture group
858 4) Now, not capturing anything when unnamed ( correct behavior)
861 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
867 * syntax.cs: converted to unix line endings.
869 2004-03-30 Lluis Sanchez Gual <lluis@ximian.com>
871 * collections.cs: In the indexer, return an empty group if the requested
873 * match.cs: Added default constructor for Group.
875 2004-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
877 * parser.cs: fixed group numbering.
879 2004-03-22 Jackson Harper <jackson@ximian.com>
881 * parser.cs: Use the group number as the name in mapping. Patch by
883 * regex.cs: Fix off by one error. Patch by Gert Driesen.
885 2004-03-17 Francois Beauchemin <beauche@softhome.net>
886 * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs :
887 Revised support for RigthToLeft.
888 quicksearch has now an reverse option.
889 This fixes bug #54537
891 * regex.cs, compiler.cs :
892 Some code to support CILCompiler.
894 Added some undocumented of MS.
896 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
898 * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797.
900 2004-02-01 Miguel de Icaza <miguel@ximian.com>
902 * syntax.cs, interval.cs: Applied patch from Marco Cravairo
903 through Francois Beauchemin who reviewed on the mailing list.
904 This fixes bug #45976
906 2004-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
908 * parser.cs: an opening brace without a
909 quantifier do not cause a parse error. Fixes bug #52924.
911 2004-01-07 Lluis Sanchez Gual <lluis@ximian.com>
913 * regex.cs: In Split(), if the last match is at the end of the string,
914 an empty string must be added to the array of results.
916 2003-12-15 Sanjay Gupta <gsanjay@novell.com>
917 * match.cs: Check for null value before Substring method call.
920 2003-11-21 Juraj Skripsky <js@hotfeet.ch>
922 * quicksearch.cs: Create and use hashtable only for "long" search
925 (Search): Use simple scan for a single-character search strings.
927 (GetChar): Simplify case sensitivity handling.
929 2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
931 * interpreter.cs: when evaluating a degenerate match, restore the
932 RepeatContext if fail. Fixes bug #42529.
934 2003-11-22 Jackson Harper <jackson@ximian.com>
936 * regex.cs: Add CultureInvariant flag to RegexOptions.
938 2003-11-20 Juraj Skripsky <js@hotfeet.ch>
940 * quicksearch.cs: Use a hashtable instead of an array for the
941 shift table to improve the memory usage.
943 2003-11-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
946 (Split): include capture groups in the results, if any. Fixes bug
949 2003-07-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
951 * regex.cs: patch from Eric Lindvall <eric@5stops.com> that fixes bug
954 2003-03-05 Miguel de Icaza <miguel@ximian.com>
956 * category.cs (CategoryUtils.CategoryFromName): Use StartsWith
957 ("Is") instead of a substring for (0,2) which was throwing an
958 exception causing Category.None to be returned
960 2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
962 * collections.cs: fixed bug #30091.
964 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
966 * regex.cs: fixed little mistake (closes #35860).
968 2002-11-12 Jackson Harper <jackson@latitudegeo.com>
970 * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories
972 2002-11-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
974 * parser.cs: detect illegal \ at end of pattern. Fixes 31334.
976 2002-10-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
978 * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to
979 solve bug #32807. Also modified GetMapping to return the same as MS.
981 2002-08-28 Juli Mallett <jmallett@FreeBSD.org>
983 * arch.cs, compiler.cs: Give the interpreter machine a property
984 for the retrieval of the group count.
986 * regex.cs: Use the new GroupCount property of the factory to
987 initialise the current group count, and restructure code to compile
988 the pattern only the first time it is needed (essentially backing
989 out the previous revision of regex.cs, to use the new code.)
991 2002-08-14 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
993 * regex.cs: Added the ctr for ISerializable implementation and
994 implemented the GetObjectData function.
996 2002-07-30 Juli Mallett <jmallett@FreeBSD.org>
998 * regex.cs: Fixed bug where the expression would not be
999 re-evaluated for grouping purposes when factory caches were
1000 used, resulting in no groups being recognised after one call
1001 with a given pattern and no change in options.
1003 2002-05-13 Dan Lewis <dihlewis@yahoo.co.uk>
1005 * regex.cs: Fixed bug in split.
1007 2002-05-08 Dan Lewis <dihlewis@yahoo.co.uk>
1009 * interpreter.cs: Moved to an array-based stack representation
1010 for faster captures.
1012 * match.cs, collections.cs: Decoupled capture representation from
1013 interpreter internals.
1015 * cache.cs: Changed Key type from struct to class for speed.
1017 2002-04-06 Dan Lewis <dihlewis@yahoo.co.uk>
1019 * cache.cs: Object methods should be overridden with "override".
1021 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
1023 * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
1024 added for completeness.
1026 * regex.cs, match.cs, collections.cs: Serializable attribute.
1028 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
1030 * regex.cs: Added static Matches and IsMatch methods.
1032 2002-04-03 Dan Lewis <dihlewis@yahoo.co.uk>
1034 * ChangeLog: Added changelog.
1036 * cache.cs: Fixed bug in MRUList.Evict.