My name is Edward Tanguay. I'm an American software and web developer living and working in Berlin, Germany.
3 hours ago: If you are a developer in Berlin and need to improve your English, I'm looking for groups to teach after work: http://tanguay.info/itenglish.
5 hours ago: As far as I'm concerned, the singularity is already here, every time I wake up twitter tells me something amazing was created while I slept.
5 hours ago: We're not suffering from information overload, we're suffering from faulty filtering.
5 hours ago: Classic literature for free as nicely formatted 1-page or 2-page PDF downloads: http://www.planetebook.com/free-ebooks.asp.
5 hours ago: Yes, when you pour coffee, "a lightning storm of neuronal activity occurs almost across the entire brain": http://is.gd/eWO1T @pholdings.
22 hours ago: If you put two spaces after a period or use underlining for emphasis, you were born before 1980.
22 hours ago: Word of the day: infovore, n. an animal with a voracious appetite for information.
yesterday: It's said that on average people use less than 10% of their brain, but I think on average computers use less than 1% of their CPU.
2 days ago: Saturday fun: team drawing on two computers with six-year-old in a shared google doc diagram.
2 days ago: Someday I want to produce a developer podcast called "What's that?" but for now "the developer's life" is a nice genre: http://is.gd/eTURO.
3 days ago: Here's a use-case for datapod format, recording human-readable data that later can be used as a datasource: http://is.gd/eSsLg @pholdings.
C# CODE EXAMPLE created on Saturday, February 06, 2010 permalink
Base code to create a simple regex unit tester
Here's some base code I use when I've written a regex and need to test it with positive and negative cases as I tweak it.
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace Testreg2342
{
    public class Program
    {
        static void Main(string[] args)
        {
            bool unitTestPassed = true;

            List<string> goodEntries = new List<string>
            {
                "2008-12-22"
            };

            List<string> badEntries = new List<string>
            {
                "2010-12-12X",
                "2010-12-32 12:00:00"
            };

            foreach (var entry in goodEntries)
            {
                if (entry.IsValidDateFormat())
                    Console.WriteLine("ok: good entry correctly passed: " + entry);
                else
                {
                    Console.WriteLine("**FAIL** GOOD ENTRY INCORRECTLY DID NOT PASS: " + entry);
                    unitTestPassed = false;
                }
            }

            foreach (var entry in badEntries)
            {
                if (!entry.IsValidDateFormat())
                    Console.WriteLine("ok: bad entry corrcectly did not pass : " + entry);
                else
                {
                    Console.WriteLine("**FAIL** BAD ENTRY INCORRECTLY PASSED: " + entry);
                    unitTestPassed = false;
                }
            }

            Console.WriteLine();
            if(unitTestPassed)
                Console.WriteLine("unit test passed");
            else
                Console.WriteLine("UNIT TEST FAILED, CORRECT ALL ENTRIES MARKED **FAIL** ABOVE!");

            Console.ReadLine();

        }
    }

    public static class StringHelpers
    {
        public static bool IsValidDateFormat(this string purportedDateFormat)
        {
            return RegexHelpers.Matches(purportedDateFormat, @"^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$");
        }
    }

    public static class RegexHelpers
    {

        //use if you are expecting only one match, e.g. from "id = ???"
        public static string GetMatch(string text, string regex)
        {
            Match match = Regex.Match(text, regex);
            if (match.Success)
            {
                string theMatch = match.Groups[0].Value;
                return theMatch;
            }
            else
            {
                return null;
            }
        }

        public static bool Matches(string text, string regex)
        {
            if (GetMatch(text, regex) != null)
                return true;
            else
                return false;
        }
    }
}
need markup?