Full email validation
Okay, now that we're over the basic examples lets get to some real expressions. As any person knows, an email expression can get pretty nasty, especially if you want to valid the domain extension and IPv4/6 addresses. While this code doesn't produce what I'd call a production quality email validator it does a pretty darn good job. Let's take a look at it:

// This expression needs to validate an email address or an empty string
RegexBuilder builder = new RegexBuilder(allowEmptyString: true);

builder
    .StartOfAString()

    .MatchCharacterSet("a-zA-Z0-9!#$%&'*+-/=?^_`{|}~.").QuantifierRange(2, 64) // at least 2 characters long and a max of 64 from the character set

    .AddText('@') // the @

    // the first parameter specifies if the alternate should be in a capture group (default is true)
    // the second parameter specifies if each alternate should be in its own capture group (default is false)
    .Alternation(true, true, // the domain is either ipv4, ipv6, domain, or localhost
        ipv6 => ipv6 // ipv6 in the format of [IPv6:{code}]
            .AddText(@"\[[Ii][Pp][Vv]6:", false) // the beginning [IPv6:
            .Alternation(
                loopback => loopback
                    .AddText("::1")
                ,
                standard => standard
                    .LogicalGrouping(group1 => group1
                        .MatchCharacterSet("0-9a-fA-F").QuantifierRange(1, 4)
                    ).QuantifierRange(1, 8)
            )
            .AddText("]")
        ,
        ipv4 => ipv4 // ipv4 in the format of [XXX.XXX.XXX.XXX]
            .AddText("[")
            .LogicalGrouping(group1 => group1
                .MatchCharacterSet("0-9").QuantifierRange(1, 3)
                .AddText('.')
            ).Quantifier(4)
            .AddText("]")
        ,
        domain => domain // standard domain suffix
            .MatchCharacterSet("a-zA-Z0-9-.").QuantifierMinimum(1) // start with some characters

            .LogicalGrouping(suffix => suffix
                .AddText('.') // we need the dot
                .LogicalGrouping(tld => tld
                    .AddText("[Aa][Ee][Rr][Oo]", false).Or()
                    .AddText("[Aa][Ss][Ii][Aa]", false).Or()
                    .AddText("[Bb][Ii][Zz]", false).Or()
                    .AddText("[Cc][Aa][Tt]", false).Or()
                    .AddText("[Cc][Oo][Oo][Pp]", false).Or()
                    .AddText("[Cc][Oo][Mm]", false).Or()
                    .AddText("[Ii][Nn][Ff][Oo]", false).Or()
                    .AddText("[Ii][Nn][Tt]", false).Or()
                    .AddText("[Jj][Oo][Bb][Ss]", false).Or()
                    .AddText("[Mm][Oo][Bb][Ii]", false).Or()
                    .AddText("[Mm][Uu][Ss][Ee][Uu][Mm]", false).Or()
                    .AddText("[Nn][Aa][Mm][Ee]", false).Or()
                    .AddText("[Nn][Ee][Tt]", false).Or()
                    .AddText("[Oo][Rr][Gg]", false).Or()
                    .AddText("[Pp][Oo][Ss][Tt]", false).Or()
                    .AddText("[Pp][Rr][Oo]", false).Or()
                    .AddText("[Tt][Ee][Ll]", false).Or()
                    .AddText("[Tt][Rr][Aa][Vv][Ee][Ll]", false).Or()
                    .AddText("[Xx]{3}", false).Or()
                    .AddText("[Ee][Dd][Uu]", false).Or()
                    .AddText("[Gg][Oo][Vv]", false).Or()
                    .AddText("[Mm][Ii][Ll]", false).Or()
                )
            ).OptionallyAnyQuantity()
        , 
        local => local // always accept localhost!
            .AddText("[Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt]", false)
    )

    .EndOfAString();

Regex regex = builder.CreateRegex();


The expression created by this is: (^$)|(^[a-zA-Z0-9!#\$%&'\*\+-/=\?\^_`\{\|\}~\.]{2,64}@((\[[Ii][Pp][Vv]6:::1|([0-9a-fA-F]{1,4}){1,8}\])|(\[([0-9]{1,3}\.){4}\])|([a-zA-Z0-9-\.]{1,}(\.([Aa][Ee][Rr][Oo]|[Aa][Ss][Ii][Aa]|[Bb][Ii][Zz]|[Cc][Aa][Tt]|[Cc][Oo][Oo][Pp]|[Cc][Oo][Mm]|[Ii][Nn][Ff][Oo]|[Ii][Nn][Tt]|[Jj][Oo][Bb][Ss]|[Mm][Oo][Bb][Ii]|[Mm][Uu][Ss][Ee][Uu][Mm]|[Nn][Aa][Mm][Ee]|[Nn][Ee][Tt]|[Oo][Rr][Gg]|[Pp][Oo][Ss][Tt]|[Pp][Rr][Oo]|[Tt][Ee][Ll]|[Tt][Rr][Aa][Vv][Ee][Ll]|[Xx]{3}|[Ee][Dd][Uu]|[Gg][Oo][Vv]|[Mm][Ii][Ll]|))*)|([Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt]))$)

This is a prime example of a fairly complicated regular expression that you might put into your code. What happens if you need to modify this, or somebody else attempts to modify this? While the code is lengthy it hands-down is easier to manipulate and comprehend.