Hi,
I'm trying to setup more checks for non-RFC822/1123 header fields. I'm
not sure if this is correct, so i would like to check with you...
char = "[-~]+"
ctext = "([-'*-[]-~])+"
quoted_pair = "(\\$char)+"
comment = "(\($ws($ctext|$quoted_pair)?$ws\))*"
These are the corresponding parts of the RFC:
; ( Octal, Decimal.)
CHAR = <any ASCII character> ; ( 0-177, 0.-127.)
CR = <ASCII CR, carriage return> ; ( 15, 13.)
comment = "(" *(ctext / quoted-pair / comment) ")"
ctext = <any CHAR excluding "(", ; => may be folded
")", "\" & CR, & including
linear-white-space>
quoted-pair = "\" CHAR ; may quote any char
Can anyone tell me if this is ok what i have i done here?
I have at least two things i'm not sure about, except for the syntax of
the regexps.
1. I think i cannot have $comment to be complete correct because of this
call to itself. This will cause a problem with nested "(" and ")" i
guess. Can i escape these problems by adding those parentheses to
both $ctext and $quoted_pair?
2. How to exclude CR from ctext? I just don't see how i chould specify
this here.
Any idea's?
-Rejo.
--
= Rejo Zenger [Sister Ray Crisiscentrum]
rejo(_at_)sisterray(_dot_)xs4all(_dot_)nl
= http://mediaport.org/~sister PGP: see headers
--------------------------------------------------------------------------------