Created
July 8, 2011 00:33
-
-
Save jrwren/1070864 to your computer and use it in GitHub Desktop.
This file contains 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
using System; | |
using NUnit.Framework; | |
namespace scratch | |
{ | |
[TestFixture()] | |
public class Test | |
{ | |
[Test()] | |
public void TestCase () | |
{ | |
var input = "<html>\n<li>file1;1\n<li>file2;1\n</html>"; | |
var re=new System.Text.RegularExpressions.Regex(@"<html>(?:\s*<li>([^;]+);1)+\s*</html>"); | |
var m =re.Match(input); | |
Assert.AreEqual("file1", m.Groups[1].Captures[0].Value); | |
Assert.AreEqual("file2", m.Groups[1].Captures[1].Value); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment