Created
November 22, 2011 00:53
-
-
Save groovyghoul/1384535 to your computer and use it in GitHub Desktop.
My RegEx Collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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