2

I have the Roundcube Webmail v. 1.3.1 mail client with managesieve v. 8.7 extension and want to add some regex driven actions for my mail and the only documentation I found on the regex flavour is this document. However I can't find which special characters it supports like \n (or is it \\n?), \r or \d etc. and how to write them. There is a mention of character groups defined through [: :] which works however I would rather use \n (which does not seem to be working) instead of broader [:cntrl:] or [:space:] or such.

In the document there is written that it has to support POSIX ERE standard however I am familiar with different flavours of regexes (PERL type) so I find that rather difficult.

Can you help with finding out which special characters and character sequences are supported in that? Which characters are not special etc.?

I came up with a simple regex to match a date in YYYY/MM/DD then space then time in HH:MM:SS format then line break and then whatever at the start of a body of a mail but it does not seem to be working. Here is the Sieve code:

require ["body","fileinto","regex","vacation"];
# rule:[date and time]
if anyof (body :text :regex "[[:digit:]]{2}/[[:digit:]]{2}/[[:digit:]]{4} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}[[:space:]](.*[[:space:]]*)*")
{
vacation text:
YOU DID IT!
.
;
}
VaNa
  • 127
  • 5

1 Answers1

1

The Sieve documentation that you linked to specifies that it conforms to POSIX Regular Expression Syntax, which is documented at

http://pubs.opengroup.org/onlinepubs/9699919799/nframe.html

This would be the most definitive reference.

Thomas N
  • 436
  • 2
  • 9