string s = "$edd|$head|";foreach (Match match in Regex.Matches(s, @"(?<!\w)$\w+|")){ Console.WriteLine(match.Value);}
string
input =
"$edd| $head| $cafe|"
;
foreach
(Match match
in
Regex.Matches(input,
"(\\$\\w+)|"
))
{
Console.WriteLine(match.Groups[1].Value);
}
input
protected void Page_Load(object sender, EventArgs e) { string input = "OneTwoThree"; // B // The regular expression we use to match Regex r1 = new Regex(@"One([A-Za-z0-9\-]+)Three"); // C // Match the input and write results Match match = r1.Match(input); if (match.Success) { string v = match.Groups[1].Value; Response.Write(v); } }
string s = "$egg| $head| $cafe|"; Response.Write(s.Substring(s.IndexOf('$')+1, s.IndexOf('|')));