Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expression Global Option

Status
Not open for further replies.

murrayja

Programmer
May 6, 2000
90
US
Does anyone know how to set the 'Global' option?
The 'IgnoreCase' option is enumerated but not Global.
I am using c# Express 2005.
 
There is no need for a Global option when matching.
Do you refer to the global replace and in this case there are overloaded Regexe.Replace() methods.
obislavu
 
Sure there is a need. When you want to stop the regular expression search at the first occurence.
 
Okay, for that you have Match class and there Match.Groups and Match.NextMatch().
obislavu
 
The global property relates to the regular expression class.
If global is false the matching stops after one hit.
This happens while the match collection is being built.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top