Consider the two following regular expression snippets and dummy HTML that it should be matching:
Apparently, I can only post one link until I get more reputation, so the link below contains the three links I referenced above:
The difference between the two snippets, if anyone is wondering, is a removed (((.{2,20}?), (.{2,20}?))?) about half-way through the snippet.
The first snippet does not match the text, but the second one does, and I cannot figure out why. I tried putting a dummy expression that should match anything in its place (such as (.{1})?) and it still fails to match it, but when I remove it, it suddenly matches again.
I’ve been toiling with this stupid expression for the last 4 hours and I’m about at my wits’ end. Can anybody help?
It was a bit easier to rewrite it than to debug it, so here’s my approach :
It works for your example and you can tweak it if you like more or less validation.