I

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:

#((?:(?<!\)"(?:(?:(?:[x20x09]*[rn])?[x20x09]+)?(?:[x01-x08x0b-x0cx0
e-x1fx7fx21x23-x5bx5d-x7e]|\[x01-x09x0b-x0cx0e-x7f]))*(?:(?:[x20
x09]*[rn])?[x20x09]+)?"|[^"(]+|\["(]|^)+)(?:(?:(?:(?:(?:[x20x09]*[rn])
?[x20x09]+)?(?P<comment>((?:(?:(?:[x20x09]*[rn])?[x20x09]+)?(?:[x01-x
08x0b-x0cx0e-x1fx7fx21-x27x2a-x5bx5d-x7e]|\[x01-x09x0b-x0cx0e-
x7f]|(?P>comment)))*(?:(?:[x20x09]*[rn])?[x20x09]+)?)))+(?:(?:[x20x09]*
[rn])?[x20x09]+)?|(?:[x20x09]*[rn])?[x20x09]+))#

(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 :P.

7 thoughts on “I”

  1. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">