The other day I sat with a regular expression problem. Eventually I solved it a different way, without regular expressions, but I would still like to know how you do it :)
The problem I was having was running svn update via an automated script, and I wanted to detect conflicts. Doing this with or withouth regex is trivial, but it got me thinking about a more obscure problem: How do you match exactly ONE occurence of a character inside a fixed length field of whitespace ?
For instance, let's say we wanted to match "C" inside a six-byte wide field:
"C " MATCH " C " MATCH " C C " NO MATCH " M " NO MATCH " " NO MATCH "C " NO MATCH (7 characters, not 6) " C " NO MATCH (5 characters, not 6)