I was toying around with regexs this morning and learned a few things I had just never taken the time to learn before. In any case, I came up with this:
#((?:(?<!\\)\"(?:(?:(?:[\x20\x09]*[\r\n])?[\x20\x09]+)?(?:[\x01-\x08\x0b-\x0c\x0
e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|\\[\x01-\x09\x0b-\x0c\x0e-\x7f]))*(?:(?:[\x20\
x09]*[\r\n])?[\x20\x09]+)?\"|[^"(]+|\\["(]|^)+)(?:(?:(?:(?:(?:[\x20\x09]*[\r\n])
?[\x20\x09]+)?(?P<comment>\((?:(?:(?:[\x20\x09]*[\r\n])?[\x20\x09]+)?(?:[\x01-\x
08\x0b-\x0c\x0e-\x1f\x7f\x21-\x27\x2a-\x5b\x5d-\x7e]|\\[\x01-\x09\x0b-\x0c\x0e-\
x7f]|(?P>comment)))*(?:(?:[\x20\x09]*[\r\n])?[\x20\x09]+)?\)))+(?:(?:[\x20\x09]*
[\r\n])?[\x20\x09]+)?|(?:[\x20\x09]*[\r\n])?[\x20\x09]+))#
(of course ignoring line breaks.) An ‘atta boy’ (or girl as the case may be) to anybody that can tell me what this would be used for
.
Destroying alien invaders by confusing their computer systems?
*blink* *blink* *blinkity blink*
That would defenatly be used to get people to waste their time trying to figure it out
PP or get a raise by showing l33t sk1llz
Mmm, it’s so strange, does it have a meaning?
I’ll tell you what it isn’t used for – doing anything at all with EBCDIC!
Any reason you went for the difficult to read, difficult to remember \x20\x09 instead of just \s?
Yah, the \s character is more encompassing than just space and tab. It includes line feeds and carriage returns as well as the form feed character (\f) which the RFC doesn’t allow.