Take the 2-minute tour ×  I have a Regex object created with the
new Regex(string pattern) constructor, is there a way afterwards
to see what pattern the regex object was created with?  I can't
seem to be able to access the "pattern" string member in either
the Regex or in RegexOptions objects.  Context: Reason I'm
asking is I'm creating a few regex objects early on while
initializing (patterns are stored in a config file), they then
get passed to a different class to be used frequently. However,
I also need to compare the pattern string to those stored in a
SQL database at run-time.  I would prefer not having to pass a
string with the pattern in addition to the regex object. I also
feel that creating the object once at startup is not a bad idea
since the regex will be reused hundreds of times?  Feel free to
provide alternative advices.  share|improve this question
protected internal string pattern That's really awkward... – 
Andre Calil Aug 19 '12 at 2:49 @Andre Calil Hmm.. perhaps they
wanted to keep the fr