It's not the best in the world, but it does the job:
// using System.Text.RegularExpressions;
/// /// Regular expression built for C# on: Mon, Sep 6, 2010, 12:26:15 PM
/// Using Expresso Version: 3.0.3634, http://www.ultrapico.com
///
/// A description of the regular expression:
///
/// <%
/// <%
/// Any character that is NOT in this class: [\"], any number of repetitions
/// "
/// [InQuotes]: A named capture group. [.*]
/// Any character, any number of repetitions
/// Match a suffix but exclude it from the capture. [\"]
/// Literal "
/// Any character that is NOT in this class: [%], any number of repetitions
/// %>
/// %>
///
///
///
public static Regex regex = new Regex(
"<%[^\\\"]*\"(?.*)(?=\\\")[^%]*%>",
RegexOptions.IgnoreCase
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled
);
// This is the replacement string
public static string regexReplace =
"";
//// Replace the matched text in the InputText using the replacement pattern
// string result = regex.Replace(InputText,regexReplace);
//// Split the InputText wherever the regex matches
// string[] results = regex.Split(InputText);
//// Capture the first Match, if any, in the InputText
// Match m = regex.Match(InputText);
//// Capture all Matches in the InputText
// MatchCollection ms = regex.Matches(InputText);
//// Test to see if there is a match in the InputText
// bool IsMatch = regex.IsMatch(InputText);
//// Get the names of all the named and numbered capture groups
// string[] GroupNames = regex.GetGroupNames();
//// Get the numbers of all the named and numbered capture groups
// int[] GroupNumbers = regex.GetGroupNumbers();
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.