procmail
[Top] [All Lists]

Re: Defining comments

1999-11-27 02:42:37
++ 26/11/99 10:57 +0200 - era eriksson:
     CHAR        =  <any ASCII character>        ; (  0-177,  0.-127.)
  char         = "[-~]+"

(This is how this came through. Doesn't look right, does it? Perhaps
you have a real NUL and a real DEL there, though. Or NUL to ~ (126))

Yes, it did came through correctly. Is supposed this was what i needed
as i thought it defines char to be a character range of nothing (NUL) to
~ (126). It should be NUL to (127), but i didn't know how to insert DEL
in this range. :-)

Anyway, if you would have to define a variabel that matches all ASCII
codes up to 127?

     ctext       =  <any CHAR excluding "(",     ; => may be folded
                     ")", "\" & CR, & including linear-white-space> 
  ctext        = "([-'*-[]-~])+"

This doesn't look right, either. In regular expressions in general,
any ] is the closing bracket unless it's the first character in the
class (after any ^ modifier and possibly -) but frankly, I'm not sure
Procmail follows tradition here 100%.

Well, there's one thing i don't understand here. The Quick Reference
says (if i understand this correctly) that i don't need to escape
characters inside a character class. This is true?

Also, you're explanation and you're test (what matches what and when) is
a little bit difficult for me to follow, so i'll respond to that later.
I do need some more time or help on that... :-)

match causes a transition from one state to another. The automaton
doesn't have a way to remember whether it's been in the same state
before, so it can't know how many opening parens there have been.

But it doesn't matter that much for what i want to achieve i guess as it
doesn't matter how many opening parens there has been as long as the
first one is closed properly. I have to look for

  (foo bar)

and it doesn't matter if it is written as

  (foo (bar (baz) era))

as it is a comment anyway because of the first and last parentheses.
Correct?

2. How to exclude CR from ctext? I just don't see how i chould specify
   this here.

Hey, I had never thought of that. How +would+ one do that? Philip?

Hehehe... i was thinking creating regexps that check for RFC valid
header fields wouldn't be too dificult as long as i would follow the RFC
closely enough. And i was mistaken there. :-) Anyway, is it possible to
specify the ASCII decimal representation for a character? If so, i
simply could use 13.

Thanks for your help Era...

        -Rejo.

-- 
= Rejo Zenger  [Sister Ray Crisiscentrum]               
rejo(_at_)sisterray(_dot_)xs4all(_dot_)nl
= http://mediaport.org/~sister                                  PGP: see headers
--------------------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>