1 2010-07-20 Miguel de Icaza <miguel@novell.com>
3 * parser.cs (ParseEscape): Now parses with some context, whether
4 we are parsing inside a character range which can not contain
5 back-references or when we are parsing on a string context which
6 can contain back references.
8 This fixes bug #577346 which exposed a bug parsing this:
10 new Regex("[\\177-\\377]")
12 2010-06-29 Raja R Harinath <harinath@hurrynot.org>
14 Mitigate a possible source of unbounded memory growth
15 * interpreter.cs (Backtrack): Move mark_start back, and invalidate
18 2010-06-29 Raja R Harinath <harinath@hurrynot.org>
20 Make trace output resemble assembler listing
21 * compiler.cs (LinkRef.ToString) [TRACE_REGEX]: Add pretty-printer
23 (TraceRegexp): Indent the output.
24 (TraceRegexpLabel): New. Prints out a line label.
25 (EmitCount): Don't trace. All callers are traced.
26 (ResolveLink): Trace line labels.
28 2010-06-21 Rodrigo Kumpera <rkumpera@novell.com>
30 * compiler.cs: Use conditional compilation to enable
31 tracing to avoid code bloat.
33 2010-06-21 Rodrigo Kumpera <rkumpera@novell.com>
35 * parser.cs: Handle repetition of position assertions.
39 2010-06-21 Rodrigo Kumpera <rkumpera@novell.com>
41 * compiler.cs: Add new internal flag to switch on regexp tracing.
42 The code is a statc readonly variable so the JIT can eliminate
43 all tracing code during normal runs.
45 2010-03-20 Miguel de Icaza <miguel@novell.com>
47 * RxInterpreter.cs: Removed warnings.
49 2010-02-03 Rodrigo Kumpera <rkumpera@novell.com>
51 * BaseMachine.cs (Split): Don't add empty strings if they don't come from
52 the first capture group. Fixes #566117.
54 2010-01-12 Miguel de Icaza <miguel@novell.com>
56 * Regex.cs: Re-enable the new regex compiler as the bug seems to
59 2009-09-07 Raja R Harinath <harinath@hurrynot.org>
61 * Regex.cs (Escape, Unescape): Add null checks.
62 (validate_options): Add ECMAScript option checks.
63 (Replace, Split): Add a few bounds checks.
65 2009-09-07 Raja R Harinath <harinath@hurrynot.org>
67 Add some null checks and bounds checks.
68 * Regex.cs (default_startat): New. Replaces the fragment
69 'RightToLeft ? input.Length : 0' with a null-safe variant.
70 (Replace) <string variant>: Add null checks for argument strings.
72 (.ctor): Likewise. Validate regex options partially.
73 (Match): Add null check on string arguments, and bounds checks for
74 offset and length arguments.
76 2009-08-20 Raja R Harinath <harinath@hurrynot.org>
78 Final piece of explicit numeric group support
79 * parser.cs (gap): New.
80 (GetMapping): Return it.
81 (ResolveReferences): Collect explicit numeric groups which may not
83 (HandleExplicitNumericGroups): New. Process the above list to
84 assign appropriate indices, and compute the correct value of 'gap'.
86 2009-08-20 Raja R Harinath <harinath@hurrynot.org>
88 * syntax.cs (CapturingGroup.Index): Rename from Number to clarify
90 (CapturingGroup.CompareTo): New.
91 * parser.cs, syntax.cs: Update to changes.
93 2009-08-20 Raja R Harinath <harinath@hurrynot.org>
95 Implement some more group number/index distinction
96 * Regex.cs (gap, Gap): New.
97 (Init, InitNewRegex): Update it.
98 (GroupNumberFromName): If the 'name' is beyond the gap, it is an
99 explicit numeric group -- use the name as the group number.
100 (GetGroupIndex): Use a binary search to map a group number to its
101 index when we know that they don't match.
102 (GroupNumbers): Use group number, not group index, for explicit
104 * Match.cs (.ctor): Use the newly introduce 'Regex.Gap'.
106 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
108 * Regex.cs (group_numbers): New.
109 (GetGroupNumbers): Move array initialization ...
110 (GroupNumbers): ... to new on-demand initializer.
112 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
114 * Regex.cs (group_names): Rename from _groupNumbersToNameMap.
115 (GetGroupNamesArray): Use an IDictionaryEnumerator to walk the
116 mapping, since both the key and value are used in the loop.
118 2009-08-19 Raja R Harinath <harinath@hurrynot.org>
120 Introduce 'gap' concept into all the variants of regex
121 * arch.cs (IMachineFactory::Gap): New property.
122 * compiler.cs (InterpreterFactory): Update to changes.
123 * RxCompiler.cs (RxInterpreterFactory): Likewise.
124 * JvmReMachineFactory.cs: Likewise.
125 * parser.cs (GetMapping): Return the 'gap' index. Move creation
126 of mapping dictionary ...
127 * Regex.cs (CreateMachineFactory): ... here. Update to changes.
129 2009-08-18 Raja R Harinath <harinath@hurrynot.org>
131 Distinguish between the internal index of a group and group number.
132 * Regex.cs (GetGroupIndex): New.
133 (GroupNameFromNumber): Use it.
134 * GroupCollection.cs (.ctor): Introduce 'gap' argument. It is the
135 index of the first group whose group number differs from its index.
136 (Item.get): Likewise.
138 2009-08-18 Raja R Harinath <harinath@hurrynot.org>
140 * parser.cs (GetMapping): Extend duplicate check for numeric
143 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
145 * parser.cs (ResolveReferences): Handle some cases of
146 explicitly-named numeric groups.
148 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
150 * parser.cs (ResolveReferences): Rearrange slightly to prepare for
153 2009-08-17 Raja R Harinath <harinath@hurrynot.org>
155 * Regex.cs (GetGroupNumbers): List group numbers in ascending order.
156 (GetGroupNames): List names in order of group number.
158 2009-08-12 Raja R Harinath <harinath@hurrynot.org>
160 * syntax.cs (BackslashNumber.ResolveReference): Improve ECMAScript
161 semantics. Handle cases like "group 43 exists but group 4 doesn't".
163 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
165 * syntax.cs (BackslashNumber.ResolveReference): Implement fallback
166 to octal numbers, and ECMAScript semantics.
167 * parser.cs (ResolveReferences): Use it.
169 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
171 * syntax.cs (BackslashNumber): New class.
172 * parser.cs (ParseSpecial): Create it instead of 'Reference' if a
173 numeric backreference is seen.
175 2009-08-10 Raja R Harinath <harinath@hurrynot.org>
177 * parser.cs (ResolveReferences): Allow named groups to be
178 referred-to by their group numbers too.
180 2009-04-23 Sebastien Pouliot <sebastien@ximian.com>
182 * Regex.cs: Remove Compiler-related support for NET_2_1
183 * RegexOptions.cs: Remove Compile from values available on NET_2_1
185 2009-03-04 Zoltan Varga <vargaz@gmail.com>
187 * RxInterpreter.cs (ResetGroups): Avoid allocating larger than needed
190 2009-02-27 Jonathan Pryor <jpryor@novell.com>
192 * Regex.cs (Replace): Check that input & evaluator are not null, as
193 documented in MSDN (and the variance found while testing DbLinq).
195 2009-02-27 Zoltan Varga <vargaz@gmail.com>
197 * BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an
198 appropriate initial length.
200 2009-02-24 Zoltan Varga <vargaz@gmail.com>
202 * CILCompiler.cs: Partially inline calls to Char.ToLower () to speed
203 up ignorecase matching.
205 2009-02-16 Jb Evain <jbevain@novell.com>
207 * Regex.cs: on the NET_2_1 profile, always use the old engine for now.
209 2009-02-14 Zoltan Varga <vargaz@gmail.com>
211 * Regex.cs: Add a MONO_NEW_RX variable to enable the new regex
214 2009-02-04 Zoltan Varga <vargaz@gmail.com>
216 * Regex.cs: Disable the new regex engine for now.
218 2009-01-14 Zoltan Varga <vargaz@gmail.com>
220 * CILCompiler.cs: Avoid throwing exceptions for a few more unhandled opcodes.
221 Implement the reverse/ignorecase versions of Reference. Fix the reverse
222 version of Bitmap. Error out if a Jump opcode jumps outside the current
223 pc range. This works around #466151.
225 2009-01-12 Jb Evain <jbevain@novell.com>
227 * RxInterpreter.cs: set trace_rx to false for NET_2_1.
228 * Regex.cs: set old_rx to false for NET_2_1.
230 2009-01-07 Zoltan Varga <vargaz@gmail.com>
232 * RxInterpreter.cs: Add support for constant strings in anchors. Fixes
235 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
237 * cache.cs: avoid infinite loop.
239 2008-11-14 Gonzalo Paniagua Javier <gonzalo@novell.com>
242 * Regex.cs: honor CacheSize value.
244 2008-11-13 Zoltan Varga <vargaz@gmail.com>
246 * RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841.
248 2008-11-11 Zoltan Varga <vargaz@gmail.com>
250 * CILCompiler.cs: Implement Reference opcode.
252 2008-10-30 Zoltan Varga <vargaz@gmail.com>
254 * CILCompiler.cs: Implement SubExpression opcode.
256 * CILCompiler.cs: Save and restore strpos in the Test opcode. Fixes
259 2008-10-25 Zoltan Varga <vargaz@gmail.com>
261 * CILCompiler.cs: Implement Test opcode.
263 2008-10-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
265 * RxInterpreter.cs: implement missing Unicode* opcodes and
266 StringReverseIgnoreCase.
268 2008-10-25 Zoltan Varga <vargaz@gmail.com>
270 * RxOp.cs: Remove unused Generic opcodes.
272 * RxCompiler.cs: Emit opcodes with flags using methods which can be
273 overriden by CILCompiler.cs, so we only have to override a few methods.
275 * CILCompiler.cs: Simplify based on the RxCompiler changes. Implement
276 UnicodeString opcode. Throw a NotImplementedException when an unsupported
277 opcode is encountered, since the IL compiler is now believed to be feature
280 2008-10-24 Zoltan Varga <vargaz@gmail.com>
282 * RxInterpreter.cs CILCompiler.cs gen-interp.cs: Fix the reading of short
283 values from the instruction stream.
285 * RxOp.cs: Add some missing unicode opcodes.
287 * gen-interp.cs RxInterpreter.cs: Generate Bitmap/UnicodeBitmap opcodes too.
289 * CILCompiler.cs (EmitEvalMethodBody): Add an 'end_pc' argument to mark the
290 end of the bytecode range which needs to be compiled. Use it to avoid
291 compiling the same bytecode multiple times in various opcodes. Fix
292 RxOp.Jump implementation. Add implementation for unicode opcodes.
294 2008-10-09 Zoltan Varga <vargaz@gmail.com>
296 * CILCompiler.cs: Implement NoBitmap/NoBitmapIgnoreCase. Fixes #432172.
298 2008-09-14 Zoltan Varga <vargaz@gmail.com>
300 * gen-interp.cs: New file to generate the all variants of the character
301 checking opcodes in RxInterpreter.cs.
303 * RxInterpreter.cs: Replace hand written code with code generated by
306 * RxInterpreter.cs: Fix the failure case of the No<XXX> opcodes. Fixes
309 2008-09-13 Zoltan Varga <vargaz@gmail.com>
311 * RxInterpreter.cs RxCompiler.cs: Implement some missing Category opcodes.
313 2008-09-07 Zoltan Varga <vargaz@gmail.com>
315 * CILCompiler.cs: Override ICompiler.EmitSet too so we set op_flags for
316 Bitmap opcodes too. Fixes #424073.
318 2008-09-06 Zoltan Varga <vargaz@gmail.com>
320 * Regex.cs: Make the new regex interpreter+compiler the default.
322 2008-08-31 Zoltan Varga <vargaz@gmail.com>
324 * RxInterpreter.cs: Port the Anchor+StartOfString optimization from the old
325 interpreter. Add credits.
327 * RxCompiler.cs (EmitString): Lowercase the string if ignore is true.
329 * CILCompiler.cs: Fix the setting of the match position in the
330 anchor+char optimization.
332 * CILCompiler.cs: Implement FastRepeatLazy.
334 * CILCompiler.cs: Get rid of commented out code. Also get rid of
335 frame.local_strpos_res, since the generated code already set Arg1 to
338 2008-08-30 Zoltan Varga <vargaz@gmail.com>
340 * CILCompiler.cs: Initialize all mi_ variables lazily.
342 * CILCompiler.cs: Implement FastRepeat.
344 * RxInterpreter.cs: Add back SetStartOfMatch, make it protected so as to
347 * CILCompiler.cs RxOp.cs: Merge lots of changes from RxInterpreter.cs,
350 2008-08-29 Zoltan Varga <vargaz@gmail.com>
352 * RxInterpreter.cs RxCompiler.cs RxOp.cs: Implement/fix this so all the
353 regex tests now run. The Repeat code is taken from the old interpreter.
355 2008-08-28 Zoltan Varga <vargaz@gmail.com>
357 * RxInterpreter.cs RxCompiler.cs RxOp.cs: Add support for
358 Category.AnySingleline.
360 2008-08-27 Zoltan Varga <vargaz@gmail.com>
362 * RxCompiler.cs: Use Array.Copy since Buffer.BlockCopy operates on bytes.
364 2008-07-31 Jb Evain <jbevain@novell.com>
366 * BaseMachine.cs: clean up for NET_2_1.
368 2008-06-05 Roei Erez <roeie@mainsoft.com>
370 * JvmReMachine.jvm.cs: Fix a bug in match that contains
371 empty group at the end.
373 2008-04-13 Jb Evain <jbevain@novell.com>
375 * Regex.cs: update undocumented fields for the 2.1 profile.
376 Merged from the Moonlight 2 branch.
378 2008-02-26 Zoltan Varga <vargaz@gmail.com>
380 * CILCompiler.cs: Implement StringIgnoreCase.
382 * CILCompiler.cs: Implement grouping support.
384 * CILCompiler.cs: Implement character groups.
386 2008-02-25 Zoltan Varga <vargaz@gmail.com>
388 * CILCompiler.cs: Implement lots of missing opcodes.
390 2008-02-18 Zoltan Varga <vargaz@gmail.com>
392 * CILCompiler.cs (EmitEvalMethodBody): Check for the not-yet supported
395 Thu Feb 14 19:03:00 CET 2008 Paolo Molaro <lupus@ximian.com>
397 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs, CILCompiler.cs : support for word
398 boundary position opcodes, ignorecase backreference and more capture
401 Thu Feb 14 17:11:10 CET 2008 Paolo Molaro <lupus@ximian.com>
403 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: replace EcmaDigit with
404 Range, fixed matching of "" =~ /$/, implementedt TestCharGroup.
405 Fixes and other misc opcodes implemented.
407 2008-02-13 Zoltan Varga <vargaz@gmail.com>
409 * CILCompiler.cs: Restructure some code to avoid a branch inside a loop.
411 * CILCompiler.cs: Fix the unsafe string matching code.
413 * CILCompiler.cs: Improved version which emits only one method in most cases.
415 * CILCompiler.cs: Fix some comments.
417 * CILCompiler.cs: New file, extracted from RxCompiler.cs.
419 * RxInterpreter.cs RxCompiler.cs: First version of regex IL compiler.
421 Wed Feb 13 13:18:12 CET 2008 Paolo Molaro <lupus@ximian.com>
423 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: unicode categories and
424 some grouping/capture support.
426 Tue Feb 12 19:16:49 CET 2008 Paolo Molaro <lupus@ximian.com>
428 * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: experimental new
431 2008-02-10 Zoltan Varga <vargaz@gmail.com>
433 * replace.cs (NeedsGroupsOrCaptures): New property. Determines whenever the
434 replacement process needs access to the groups or captures properties of the
437 * Group.cs: Add an internal ctor which avoids allocations.
441 * BaseMachine.cs interpreter.cs: Add an optimization to avoid fully creating
442 Match objects during Replace () if the replacement string is simple.
444 * BaseMachine.cs Regex.cs: Make LTRReplace and RTLReplace instance methods to
445 avoid creating two machines for each Regex.Replace () call.
447 * interpreter.cs (Eval): Remove a needless string allocation.
449 2007-12-04 Arina Itkes <arinai@mainsoft.com>
451 * parser.cs: Max value of m for a construct {n,m} is 2147483647.
453 2007-11-15 Miguel de Icaza <miguel@novell.com>
455 * Revert the patch from Juraj Skripsky as it made the class
456 non-thread safe (see #341986).
458 2007-11-08 Raja R Harinath <harinath@gmail.com>
461 * BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr'
462 to deduce absence of matches -- a match can have length 0.
463 (RTLReplace): Likewise.
465 2007-11-07 Raja R Harinath <harinath@gmail.com>
467 Support RegexOptions.RightToLeft in Replace().
468 * BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace
470 (LTRReplace): Make internal and rename the MatchAppendEvaluator
471 version of Replace to this.
473 * Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine.
474 * replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case.
475 Based on patch by Stephane Delcroix.
477 * replace.cs (Compile): Don't unescape string.
479 2007-11-01 Gert Driesen <drieseng@users.sourceforge.net>
481 * Match.cs: Do not throw NotSupportedException on zero-length
482 replacement argument.
484 2007-10-29 Arina Itkes <arinai@mainsoft.com>
486 * Regex.cs: Moving creation of Regex machine to ctor.
487 It increases an initialization time of Regex but reduce a
488 process time while APIs calling. Also it solves the problem
489 of missed multi thread synchronization.
491 2007-10-29 Arina Itkes <arinai@mainsoft.com>
493 * Match.cs: Fix for Result method of Match. Throwing an exception
494 if Result method was called on a failed Match.
496 2007-10-24 Juraj Skripsky <js@hotfeet.ch>
498 * Regex.cs: Store and re-use IMachine, no need to re-instantiate
499 it every time we're matching.
501 2007-10-24 Arina Itkes <arinai@mainsoft.com>
503 * Regex.cs Match.cs arch.cs compiler.cs interpreter.cs
504 Refactoring of Interpreter with extracting of base abstract class
505 that executes some methods that were moved from Regex and Match classes.
506 Added a field that maps group numbers to group names in Regex for
507 improvement of performance of GroupNameFromNumber method.
509 2007-10-21 Gert Driesen <drieseng@users.sourceforge.net>
511 * RegexTest.cs: Removed. Test was already moved to the appropriate
514 2007-06-21 Juraj Skripsky <js@hotfeet.ch>
516 * quicksearch.ch: Optimization. Add byte array as skip table for
517 chars <= 255, falling back to the hashtable for chars > 255 and
518 skip distances > 255.
520 2007-04-18 Raja R Harinath <rharinath@novell.com>
523 * parser.cs (ResolveReferences): Don't throw an expression if a
524 capture assertion reference cannot be resolved.
525 (ParseGroupingConstruct): Provide fallback expression to a capture
527 * syntax.cs (CaptureAssertion): If the bareword doesn't refer to
528 the name of a capture group, fallback to treating it as a literal
531 2007-04-04 Raja R Harinath <rharinath@novell.com>
533 * interpreter.cs (Eval) <OpCode.Reference>: Distribute for loop
535 for () if (a) s1; else s2; => if (a) for () s1; else for () s2;
537 2007-04-03 Raja R Harinath <rharinath@novell.com>
539 * Regex.cs (~Regex): Don't define in NET_2_0 profile.
541 2007-01-02 Raja R Harinath <rharinath@novell.com>
544 * parser.cs (Parser.GetMapping): Use the actual group numbers to
547 2006-09-28 Andrew Skiba <andrews@mainsoft.com>
549 * Regex.cs: TARGET_JVM
551 2006-05-30 Gert Driesen <drieseng@users.sourceforge.net>
553 * CaptureCollection.cs: Removed virtual keyword to fix API mismatches.
554 * MatchCollection.cs: Removed virtual keyword to fix API mismatches.
555 * GroupCollection.cs: Removed virtual keyword to fix API mismatches.
557 2006-05-08 Raja R Harinath <rharinath@novell.com>
560 Remove 65535-limit on number of repetitions matched by a pattern.
561 We still have a 65535 limit on the length of a pattern and the
562 number of groups in a pattern.
563 * compiler.cs (PatternCompiler.EmitCount): New. Emits an int as
564 two ushorts into the program stream.
565 (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers
567 * interpreter.cs (Intepreter.ReadProgramCount): Read an int
568 emitted into the program stream.
569 (Interpreter): Use it. Update counts.
570 (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise.
571 * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*'
572 and '+' repetition patterns.
573 * arch.cs (Info, Repeat, FastRepeat): Update description.
575 2006-04-18 Raja R Harinath <rharinath@novell.com>
577 Treat fixed repetitions of simple regexes as simple too.
578 * syntax.cs (Expression.IsComplex): Make abstract.
579 (Group.IsComplex, Alternation.IsComplex): Move ...
580 (CompositeExpression.IsComplex): ... here.
581 (Group.GetAnchorInfo): Reduce allocations. Avoid creating another
582 ArrayList, and use a StringBuilder to build up the string.
583 (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string.
584 (ExpressionAssertion.IsComplex): Override.
586 2006-04-17 Florian Gross <flgr@ccan.de>
587 Raja R Harinath <rharinath@novell.com>
589 * syntax.cs (CharacterClass.Compile): Emit categories after the
590 character intervals so that the evaluator can pick up the
593 2006-04-07 Raja R Harinath <rharinath@novell.com>
596 * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]:
597 Don't reset 'ptr' to 0 during forward scan.
600 * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first
601 tail operation has a 'negate' flag, avoid the "match next char"
605 * arch.cs (OpCode.NotCategory): New. Stands for matching a
606 character _not_ from the given category.
607 * debug.cs (DisassembleBlock): Handle it.
608 * compiler.cs (ICompiler.EmitNotCategory): New.
609 (Compiler.EmitNotCategory): New. Emit OpCode.NotCategory.
610 * syntax.cs (CharacterClass.Compile): Don't conflate negation of
611 the character class and negation of the category. Use
613 * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to
615 (Interpreter.EvalChar): Handle it.
617 2006-04-06 Raja R Harinath <rharinath@novell.com>
620 * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null
621 when evaluating the tail. Ensure that backtracks don't confuse
622 the recursion vs. iteration detector.
624 2006-04-03 Raja R Harinath <rharinath@novell.com>
626 * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a
629 2006-03-30 Raja R Harinath <harinath@gmail.com>
632 * parser.cs (Parser.ParseCharacterClass): Don't automatically
633 assume there's a range when we see '-'. Ensure that we have seen
634 at least one other character, and that we aren't already parsing a
635 range. Handle some more errors.
637 2005-12-19 Kornél Pál <kornelpal@hotmail.com>
639 * Regex.cs: Added support for regular expressions compiled to
640 assemblies by compiling the pattern. This solution ignores existing
641 CIL code but provides full support for regular expression classes
644 2005-11-21 Sebastien Pouliot <sebastien@ximian.com>
646 * CaptureCollection.cs: Fixed length check.
647 * Group.cs: Added missing validation for Synchronized method.
648 * Match.cs: Added missing validation for Synchronized and Result
650 * MatchEvaluator.cs: Added [Serializable] for 2.0 profile.
651 * RegexCompilationInfo.cs: Added missing property validation.
652 * Regex.cs: Implemented UseOptionC and UseOptionR protected methods
653 (now documented). Fixed API for 2.0 profile.
654 * RegexRunner.cs: Stubbed CharInClass for 2.0 profile.
656 2005-11-17 Sebastien Pouliot <sebastien@ximian.com>
658 * Match.cs: Removed the ": base ()" on the private ctor as it is
659 unrequired and cause an extra public ctor to added (bug #76736).
660 * MatchCollection.cs: Add missing virtual to indexer property.
662 2005-09-23 Raja R Harinath <rharinath@novell.com>
664 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the
665 sense of a test to reflect the code re-organization.
667 2005-09-22 Raja R Harinath <rharinath@novell.com>
670 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
671 cases of recursion when dealing with eager quantifiers too. We
672 now avoid recursion when handling the innermost quantifier.
673 (Interpreter.IntStack, Interpreter.stack): New. Stack to help
674 implement backtracking in eager quantifiers.
676 2005-09-21 Raja R Harinath <rharinath@novell.com>
678 * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some
679 cases of recursion when dealing with the minimum count and lazy
682 2005-08-23 Raja R Harinath <rharinath@novell.com>
684 * regex.cs: Remove. Split into ...
685 * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs,
686 RegexOptions.cs: ... these. Now every publicly exposed type in
687 this namespace has its own file.
689 2005-07-21 Florian Gross <flgr@ccan.de>
691 * Fixed a bug in category.cs that caused ECMAScript \d to fail.
693 2005-07-13 Raja R Harinath <rharinath@novell.com>
695 Make even more lazier.
696 * MatchCollection.cs (TryToGet): Don't generate match i+1 when
697 we're looking for match i. Change post-conditions.
698 (FullList): New helper property. Ensures the list is fully populated.
699 (Count, CopyTo): Use it.
700 (Enumerator.Current): Update to new post-conditions of TryToGet.
701 (Enumerator.MoveNext): Likewise. Don't modify index if we're
704 2005-07-08 Raja R Harinath <rharinath@novell.com>
706 * MatchCollection.cs: Convert to incremental mode.
707 * regex.cs (Regex.Matches): Update. Pass responsibility of
708 generating all matches to MatchCollection.
710 2005-06-14 Raja R Harinath <harinath@gmail.com>
712 * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
715 * Match.cs (Match) [zero-argument variant]: Make private.
716 * GroupCollection (Item) [string variant]: Don't look for the
717 group number in an empty match.
719 2005-06-10 Raja R Harinath <rharinath@novell.com>
721 * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
722 intermediate arrays to build the final result.
723 (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
725 * CaptureCollection.cs (list): Change from ArrayList to list.
726 (SetValue): New internal helper, used by Interpreter.PopulateGroup.
727 (Enumerator): Remove helper class.
728 (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
729 * GroupCollection.cs: Likewise.
730 * Group.cs (Group): Move responsibility of populating 'Captures'
731 to Interpreter.PopulateGroup.
732 * Match.cs (Match): Move responsibility of populating 'Groups' to
733 Interpreter.GenerateMatch.
735 2005-05-25 Raja R Harinath <rharinath@novell.com>
737 * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
738 creating several intermediate strings. Simplify internal
739 intermediate representation.
740 (ReplacementEvaluator.EvaluateAppend): New. Version of Evaluate
741 that builds the result directly on a passed-in StringBuilder.
742 (ReplacementEvaluator.Evaluate): Just a wrapper around
744 * regex.cs (MatchAppendEvaluator): New internal delegate.
745 (Regex.Replace): Use MatchAppendEvaluator.
746 (Regex.Adapter): New class used to adapt a MatchEvaluator to a
747 MatchAppendEvaluator.
749 2005-05-24 Raja R Harinath <rharinath@novell.com>
751 * replace.cs (ReplacementEvaluator.CompileTerm): Fix group
754 2005-05-20 Ben Maurer <bmaurer@ximian.com>
756 * regex.cs: Some memory allocation optimizations.
758 2005-05-20 Raja R Harinath <rharinath@novell.com>
761 * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to
762 fail and yet have advanced the pointer. Append the scanned-over
763 portion to the "literal" being built.
764 (ReplacementEvaluator.CompileTerm): Don't throw any exceptions.
765 If a term cannot be recognized, just return null.
767 * compiler.cs (InterpreterFactory.GroupCount): Fix. The 0'th
768 index corresponds to Opcode.Info.
770 * parser.cs (Parser.Unescape): If the string doesn't contain any
771 '\' character, don't allocate a new string.
773 * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename
774 from GetResult. Append to a passed-in StringBuilder rather than
776 (ReplacementEvaluator.Evaluate): Update.
778 * Capture.cs, Group.cs, Match.cs: New files split out of ...
779 * match.cs: ... this. Remove.
781 2005-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
783 * parser.cs: stuff inside {} might not be a quantifier. Fixes
786 2005-01-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
788 * quicksearch.cs: handle IgnoreCase when getting the shift distance.
789 Fixes bug #69065. Patch by mei@work.email.ne.jp.
791 2005-01-08 Miguel de Icaza <miguel@ximian.com>
793 * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug
796 * parser.cs: Turns out that \digit sequences are octal sequences
797 (no leading zero is needed); And the three octal digit rule
798 applies to the leading zero as well.
800 This fixes the Unescape method.
802 2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
804 * regex.cs: use NextMatch to move on to the next match. Fixes bug
807 2004-11-09 Atsushi Enomoto <atsushi@ximian.com>
811 2004-11-08 Ben Maurer <bmaurer@ximian.com>
813 * replace.cs, parser.cs: Use stringbuilder for allocation sanity.
815 2004-10-21 Joerg Rosenkranz <joergr@voelcker.com>
817 * regex.cs: Fixed a bug introduced with the last patch which
818 prevented any replacements when a postive count is given.
819 This also happens in all overloads without count parameter.
821 2004-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
823 * regex.cs: in Replace, when count is negative, replacement continues
824 to the end of the string.
826 Fixes bug #68398. Patch by Jon Larimer.
828 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
830 * RegexRunner.cs: fixed case mismatch of methods
832 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
834 * RegexRunner.cs: marked TODO, added missing protected internal
835 fields, throw NotImplementedException in all methods
837 2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
839 * RegexRunnerFactory.cs: removed comment, no longer throw exception
841 * regex.cs: fixed public API signature by renaming protected
842 internal fields and adding destructor, added MonoTODO attribute to
843 fields and method that are not yet implemented, changed not
844 implemented methods to throw NotImplementedException instead of
845 Exception, fixed names of field that are serialized
847 2004-06-06 Jambunathan K <kjambunathan@novell.com>
849 * parser.cs: Fixed issues with Regex.Unescape() identified as part of
850 debugging bug #58256. The original problem reported was about
851 inconsistency between the way we treat replacement patterns and the
852 way microsoft treats the replacement patterns in Regex.Replace(). MS
853 implementation is buggy and doesn't honour escape sequences in the
854 replacement patterns, even though the SDK claims otherwise.
857 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
859 * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is
860 emitting a Category.All if both a category and its negated value are
863 2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
865 * syntax.cs: reverting my previous patch. It causes bigger problems.
867 2004-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
869 * category.cs: added LastValue field to mark the end of enum Category.
870 * syntax.cs: in CharacterClass, use Category.LastValue to get the size
871 of the array needed. Use a BitArray instead of bool[].
872 In AddCategory(), don't set the opposite category as false. Fixes
873 bug #59150. All tests pass.
875 2004-05-25 Jackson Harper <jackson@ximian.com>
877 * parser.cs: Allow creating a regular expression using {,n} as the
878 specified. The min bounds is set to -1, I am not completely sure
879 if that is what it is supposed to be but MS does not set it to 0
880 based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761.
882 2004-05-12 Dick Porter <dick@ximian.com>
886 * RegexRunnerFactory.cs:
887 * RegexRunner.cs: More public API difference fixes.
889 * GroupCollection.cs:
890 * MatchCollection.cs:
891 * CaptureCollection.cs: Moved GroupCollection, MatchCollection and
892 CaptureCollection so that they no longer inherit from the
893 non-standard RegexCollectionBase class. Fixes the API difference.
895 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
902 Patch by Eric Durand Tremblay.
903 1) Capture inner group when named.
904 2) Resolved parse error caused by not capturing inner group
905 3) Resolved incorrect capture group
906 4) Now, not capturing anything when unnamed ( correct behavior)
909 2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
915 * syntax.cs: converted to unix line endings.
917 2004-03-30 Lluis Sanchez Gual <lluis@ximian.com>
919 * collections.cs: In the indexer, return an empty group if the requested
921 * match.cs: Added default constructor for Group.
923 2004-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
925 * parser.cs: fixed group numbering.
927 2004-03-22 Jackson Harper <jackson@ximian.com>
929 * parser.cs: Use the group number as the name in mapping. Patch by
931 * regex.cs: Fix off by one error. Patch by Gert Driesen.
933 2004-03-17 Francois Beauchemin <beauche@softhome.net>
934 * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs :
935 Revised support for RigthToLeft.
936 quicksearch has now an reverse option.
937 This fixes bug #54537
939 * regex.cs, compiler.cs :
940 Some code to support CILCompiler.
942 Added some undocumented of MS.
944 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
946 * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797.
948 2004-02-01 Miguel de Icaza <miguel@ximian.com>
950 * syntax.cs, interval.cs: Applied patch from Marco Cravairo
951 through Francois Beauchemin who reviewed on the mailing list.
952 This fixes bug #45976
954 2004-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
956 * parser.cs: an opening brace without a
957 quantifier do not cause a parse error. Fixes bug #52924.
959 2004-01-07 Lluis Sanchez Gual <lluis@ximian.com>
961 * regex.cs: In Split(), if the last match is at the end of the string,
962 an empty string must be added to the array of results.
964 2003-12-15 Sanjay Gupta <gsanjay@novell.com>
965 * match.cs: Check for null value before Substring method call.
968 2003-11-21 Juraj Skripsky <js@hotfeet.ch>
970 * quicksearch.cs: Create and use hashtable only for "long" search
973 (Search): Use simple scan for a single-character search strings.
975 (GetChar): Simplify case sensitivity handling.
977 2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
979 * interpreter.cs: when evaluating a degenerate match, restore the
980 RepeatContext if fail. Fixes bug #42529.
982 2003-11-22 Jackson Harper <jackson@ximian.com>
984 * regex.cs: Add CultureInvariant flag to RegexOptions.
986 2003-11-20 Juraj Skripsky <js@hotfeet.ch>
988 * quicksearch.cs: Use a hashtable instead of an array for the
989 shift table to improve the memory usage.
991 2003-11-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
994 (Split): include capture groups in the results, if any. Fixes bug
997 2003-07-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
999 * regex.cs: patch from Eric Lindvall <eric@5stops.com> that fixes bug
1002 2003-03-05 Miguel de Icaza <miguel@ximian.com>
1004 * category.cs (CategoryUtils.CategoryFromName): Use StartsWith
1005 ("Is") instead of a substring for (0,2) which was throwing an
1006 exception causing Category.None to be returned
1008 2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1010 * collections.cs: fixed bug #30091.
1012 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1014 * regex.cs: fixed little mistake (closes #35860).
1016 2002-11-12 Jackson Harper <jackson@latitudegeo.com>
1018 * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories
1020 2002-11-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1022 * parser.cs: detect illegal \ at end of pattern. Fixes 31334.
1024 2002-10-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1026 * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to
1027 solve bug #32807. Also modified GetMapping to return the same as MS.
1029 2002-08-28 Juli Mallett <jmallett@FreeBSD.org>
1031 * arch.cs, compiler.cs: Give the interpreter machine a property
1032 for the retrieval of the group count.
1034 * regex.cs: Use the new GroupCount property of the factory to
1035 initialise the current group count, and restructure code to compile
1036 the pattern only the first time it is needed (essentially backing
1037 out the previous revision of regex.cs, to use the new code.)
1039 2002-08-14 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1041 * regex.cs: Added the ctr for ISerializable implementation and
1042 implemented the GetObjectData function.
1044 2002-07-30 Juli Mallett <jmallett@FreeBSD.org>
1046 * regex.cs: Fixed bug where the expression would not be
1047 re-evaluated for grouping purposes when factory caches were
1048 used, resulting in no groups being recognised after one call
1049 with a given pattern and no change in options.
1051 2002-05-13 Dan Lewis <dihlewis@yahoo.co.uk>
1053 * regex.cs: Fixed bug in split.
1055 2002-05-08 Dan Lewis <dihlewis@yahoo.co.uk>
1057 * interpreter.cs: Moved to an array-based stack representation
1058 for faster captures.
1060 * match.cs, collections.cs: Decoupled capture representation from
1061 interpreter internals.
1063 * cache.cs: Changed Key type from struct to class for speed.
1065 2002-04-06 Dan Lewis <dihlewis@yahoo.co.uk>
1067 * cache.cs: Object methods should be overridden with "override".
1069 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
1071 * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
1072 added for completeness.
1074 * regex.cs, match.cs, collections.cs: Serializable attribute.
1076 2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
1078 * regex.cs: Added static Matches and IsMatch methods.
1080 2002-04-03 Dan Lewis <dihlewis@yahoo.co.uk>
1082 * ChangeLog: Added changelog.
1084 * cache.cs: Fixed bug in MRUList.Evict.