|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace JocysCom.Sql.ScriptsGenerator.Controls
{
public partial class XmlCommentsExtractTest : UserControl
{
public XmlCommentsExtractTest()
{
InitializeComponent();
}
private void RegExTextBox_TextChanged(object sender, EventArgs e)
{
DestinationTextBox.Clear();
ErrorMessageTextBox.Clear();
System.Text.RegularExpressions.Regex regex = null;
if (RegExTextBox.Text.Length > 0)
{
try
{
regex = new System.Text.RegularExpressions.Regex(RegExTextBox.Text, System.Text.RegularExpressions.RegexOptions.Singleline);
}
catch (Exception ex)
{
ErrorMessageTextBox.Text = ex.Message;
}
if (regex != null)
{
System.Text.RegularExpressions.MatchCollection mc = regex.Matches(SourceTextBox.Text);
int length = mc.Count;
for (int i = 0; i < length; i++)
{
DestinationTextBox.AppendText("\r\nMATCH " + i.ToString() + ": ====================================\r\n");
DestinationTextBox.AppendText(mc[i].Value);
}
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.