Click here to Skip to main content
15,887,892 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: How to find out if a cell is a date field in Excel Pin
Curtis Schlak.7-Feb-06 3:34
Curtis Schlak.7-Feb-06 3:34 
GeneralRe: How to find out if a cell is a date field in Excel Pin
thestonefox7-Feb-06 5:06
thestonefox7-Feb-06 5:06 
QuestionHow can I implement a C++ interface in C# Pin
tiancaidao6-Feb-06 22:37
tiancaidao6-Feb-06 22:37 
AnswerRe: How can I implement a C++ interface in C# Pin
Kiran Kumar Singani6-Feb-06 23:37
Kiran Kumar Singani6-Feb-06 23:37 
GeneralRe: How can I implement a C++ interface in C# Pin
tiancaidao7-Feb-06 16:58
tiancaidao7-Feb-06 16:58 
QuestionFetching dynamically generated data from a string of 10 lines using C# Pin
H he el el oooo6-Feb-06 22:16
H he el el oooo6-Feb-06 22:16 
AnswerRe: Fetching dynamically generated data from a string of 10 lines using C# Pin
leppie6-Feb-06 22:19
leppie6-Feb-06 22:19 
GeneralRe: Fetching dynamically generated data from a string of 10 lines using C# Pin
J4amieC6-Feb-06 23:59
J4amieC6-Feb-06 23:59 
GeneralRe: Fetching dynamically generated data from a string of 10 lines using C# Pin
leppie7-Feb-06 0:35
leppie7-Feb-06 0:35 

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.