J
Jeremy R. Harner
I've been trying to figure out this for many hours now. I have a file
that is in the following format:
Game #xxxxxxxxx
stuff
stuff
stuff
stuff
stuff
-----------------------------
Game #xxxxxxxxx
stuff
stuff
stuff
-----------------------------
Game #xxxxxxxxx
stuff
stuff
stuff
stuff
-----------------------------
Here is my code:
//Match from 'Game # to ----------------------------- so includes all
the stuff.
string sRegex = @"Game\s#\.+-----------------------------";
MatchCollection theMatches = Regex.Matches(sText, sRegex,
RegexOptions.Singleline);
where, sText is the above text.
I then want to do:
foreach( Match m in theMatches)
{
string s = m.ToString();
//Do other text parsing
}
I want there to be three matches. So that the string s contains
everything from Game to the line of hyphens (------------------). But
this regex finds only one match and it is the entire string all three
segments. Any ideas on what a regular expression that would work.
that is in the following format:
Game #xxxxxxxxx
stuff
stuff
stuff
stuff
stuff
-----------------------------
Game #xxxxxxxxx
stuff
stuff
stuff
-----------------------------
Game #xxxxxxxxx
stuff
stuff
stuff
stuff
-----------------------------
Here is my code:
//Match from 'Game # to ----------------------------- so includes all
the stuff.
string sRegex = @"Game\s#\.+-----------------------------";
MatchCollection theMatches = Regex.Matches(sText, sRegex,
RegexOptions.Singleline);
where, sText is the above text.
I then want to do:
foreach( Match m in theMatches)
{
string s = m.ToString();
//Do other text parsing
}
I want there to be three matches. So that the string s contains
everything from Game to the line of hyphens (------------------). But
this regex finds only one match and it is the entire string all three
segments. Any ideas on what a regular expression that would work.