Skip to content

Instantly share code, notes, and snippets.

@jrwren
Created July 8, 2011 00:33
Show Gist options
  • Save jrwren/1070864 to your computer and use it in GitHub Desktop.
Save jrwren/1070864 to your computer and use it in GitHub Desktop.
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