Possible .Net regex bug?

For reasons too dull to explain, I’m trying to use regular expressions to postprocess an HTML-stream. I want to find all anchor (<a/>) tags that link within our site, in this case using the domain name.

My regular expression looks right to me, but .Net is convinced I don’t have enough close-parentheses. I’ve added line breaks for clarity:

   (?<=<a[^>]* href=['"]?)

I’ve tested both the above code with the line breaks removed and the original code (which is compiled with RegexOptions.IgnorePatternWhitespace and has embedded comments for ease of maintenance. Each time, I get a System.ArgumentException: parsing "..." - Not enough )'s.

Despite that I’m quite certain they’re perfectly matched.


Cross-posted to ms_dot_net and regexp.


Flickr = censorship

Flickr = censorship
Originally uploaded by OwenBlacker

Flickr is now engaging in outright censorship.

The ridiculous over-prudishness of their safe-search settings, which mean that entire photostreams disappear from public view because of non-adult nudity, was bad enough.

Now German users (amongst others) can’t turn off safe search at all, even if they’re firmly over 18 and want to see content that the Daily Mail might not approve of.

Worse, Flickr is deleting dissenting comments in its discussion fora.

I don’t feel I can continue to support a site that’s more bothered by appeasing religious nuts in the US than freedom across the globe. I doubt I’ll renew my Pro status and I’ve yet to decide whether or not I’ll be staying on Flickr for much longer.

Flickr, if you really loved us, you’d set us free.