Click here to Skip to main content
15,919,931 members
Home / Discussions / C#
   

C#

 
AnswerRe: Writing a save command to save on a particualr part Pin
leppie7-Feb-06 3:25
leppie7-Feb-06 3:25 
AnswerRe: Writing a save command to save on a particualr part Pin
Dave Kreskowiak7-Feb-06 4:21
mveDave Kreskowiak7-Feb-06 4:21 
QuestionLogon code Pin
Dave McCool7-Feb-06 2:29
Dave McCool7-Feb-06 2:29 
AnswerRe: Logon code Pin
J4amieC7-Feb-06 3:15
J4amieC7-Feb-06 3:15 
QuestionWhat does any application require? Pin
Dave McCool7-Feb-06 2:25
Dave McCool7-Feb-06 2:25 
AnswerRe: What does any application require? Pin
J4amieC7-Feb-06 3:13
J4amieC7-Feb-06 3:13 
AnswerRe: What does any application require? Pin
Dave Kreskowiak7-Feb-06 4:17
mveDave Kreskowiak7-Feb-06 4:17 
AnswerRe: What does any application require? Pin
Dave McCool26-Feb-06 23:59
Dave McCool26-Feb-06 23:59 
QuestionMonitor system performance Pin
Dave McCool7-Feb-06 2:21
Dave McCool7-Feb-06 2:21 
AnswerRe: Monitor system performance Pin
J4amieC7-Feb-06 3:10
J4amieC7-Feb-06 3:10 
QuestionDigital clock on main screen Pin
Dave McCool7-Feb-06 2:07
Dave McCool7-Feb-06 2:07 
QuestionHow to reorder Listview (LargeIcon mode) Pin
fregolo527-Feb-06 2:04
fregolo527-Feb-06 2:04 
QuestionMovable button Pin
Dave McCool7-Feb-06 2:03
Dave McCool7-Feb-06 2:03 
AnswerRe: Movable button Pin
J4amieC7-Feb-06 3:12
J4amieC7-Feb-06 3:12 
QuestionFew questions reguarding RTF Pin
Dave McCool7-Feb-06 1:59
Dave McCool7-Feb-06 1:59 
QuestionRegex class and RegexOptions.Compiled option Pin
Callixte.7-Feb-06 0:39
Callixte.7-Feb-06 0:39 
AnswerRe: Regex class and RegexOptions.Compiled option Pin
Curtis Schlak.7-Feb-06 3:26
Curtis Schlak.7-Feb-06 3:26 
Callixte,

I don't think that .NET pools Regex objects. It seems that using the RegexOptions.Compiled will only give you significant benefits if you reuse the same object. I wrote the following code to test for reference and object equality, to see if .NET pools the Regex object like it pools the String object in some internal cache. However, the code seems to imply that each object stands alone.
using System;
using System.Text.RegularExpressions;

namespace ThrowAway
{
  public class TMain
  {
    [STAThread]
    public static void Main()
    {
      Regex compiled1 = new Regex( "(a(b)+)+", RegexOptions.Compiled );
      Regex compiled2 = new Regex( "(a(b)+)+", RegexOptions.Compiled );
      Regex noncompiled1 = new Regex( "(a(b)+)+" );
      Regex noncompiled2 = new Regex( "(a(b)+)+" );
      Console.WriteLine( compiled1 == compiled2 );              // Writes False
      Console.WriteLine( compiled1.Equals( compiled2 ) );       // Writes False
      Console.WriteLine( compiled1 == noncompiled1 );           // Writes False
      Console.WriteLine( compiled1.Equals( noncompiled1 ) );    // Writes False
      Console.WriteLine( noncompiled1 == noncompiled2 );        // Writes False
      Console.WriteLine( noncompiled1.Equals( noncompiled2 ) ); // Writes False
    }
  }
}
Now, this doesn't really prove anything; however, I feel that, if the .NET runtime cached compiled1 and compiled2 to the same internal pool, then at lease compiled1 == compiled2 should evaluate to true.

I hope that helps.
GeneralRe: Regex class and RegexOptions.Compiled option Pin
Callixte.7-Feb-06 3:52
Callixte.7-Feb-06 3:52 
QuestionManipulating controls in design time Pin
NewbieDude7-Feb-06 0:10
NewbieDude7-Feb-06 0:10 
Questionclearing all event handlers Pin
mintguy7-Feb-06 0:09
mintguy7-Feb-06 0:09 
AnswerRe: clearing all event handlers Pin
James Gupta7-Feb-06 1:40
professionalJames Gupta7-Feb-06 1:40 
GeneralRe: clearing all event handlers Pin
mintguy7-Feb-06 3:40
mintguy7-Feb-06 3:40 
GeneralRe: clearing all event handlers Pin
Dave Kreskowiak7-Feb-06 4:11
mveDave Kreskowiak7-Feb-06 4:11 
GeneralRe: clearing all event handlers Pin
James Gupta8-Feb-06 5:06
professionalJames Gupta8-Feb-06 5:06 
QuestionHow to find out if a cell is a date field in Excel Pin
thestonefox6-Feb-06 22:57
thestonefox6-Feb-06 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.