I just tested it using Pex for fun and - to my surprise - Pex was able to deal with regular expression and this AFAIK without any build-in knowledge of regular expressions.
using System;
using System.Text.RegularExpressions;
public class Program
{
public static String Puzzle(String input)
{
if (new Regex("123(foo|bar){3}456[0-9]{5}789").IsMatch(input))
{
throw new ArgumentException();
}
else
{
return input;
}
}
}