Skip to content

Instantly share code, notes, and snippets.

@groovyghoul
Created November 22, 2011 00:53
Show Gist options
  • Save groovyghoul/1384535 to your computer and use it in GitHub Desktop.
Save groovyghoul/1384535 to your computer and use it in GitHub Desktop.
My RegEx Collection
Interbase connection string
([^:]*)(:)(.+)
Example:
localhost:d:\ais\ins.ib
$1 = localhost
$3 = d:\ais\ins.ib
c# example:
using System.Text.RegularExpressions;
private void RegExSplit()
{
const string input = @"localhost:d:\test\ins.ib";
Match match = Regex.Match(input, @"([^:]*)(:)(.+)", RegexOptions.IgnoreCase);
if (match.Success)
{
textBox2.Text = match.Groups[1].Value;
textBox3.Text = match.Groups[3].Value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment