Matching line breaks with regexps

Christian Mueller cmueller at gmx.de
Fri Oct 24 09:08:37 BST 2003


Am Freitag, 24. Oktober 2003 08:38 schrieb Pantaleimon:
> Hello
>
> Does anyone know how to match a line break with a regexp in a KMail
> filter. I'm trying to match text like the name of the report below,
> "The Insider's Guide To Advertising for Free On The Net", which may be
> broken across several lines.
>
> > name and postal address.
> > PLACE YOUR ORDER FOR THESE REPORTS NOW :
> > ==================================================
> > REPORT # 1: "The Insider's Guide To Advertising
> > for Free On The Net"
> >
> > Order Report #1 from:
>
> A. Jones
>
> I made a few attempts, ther last one being:
>
> "The[^$\r\n\s>]+Insider's[^$\r\n\s>]+Guide[^$\r\n\s>]+To[^$\r\n\s>]+Adverti
>sing[^$\r\n\s>]+for[^$\r\n\s>]+Free[^$\r\n\s>]+On
> [^$\r\n\s>]+The[^$\r\n\s>]+Net"
>
> Unfortunately, none of them worked. Hope you can help me.

Why did you put the ^ into the square brackets: [^$\r\n\s>] ?
It inverts the character set so it matches everything *but* $, \r, \n, \s and >
I'd remove the dollar sign, too. 
I guess [\r\n\s>]+ is more what you want. 

But I'm not sure if it's possible at all to match more than one line 
with the kmail filter patterns...

Christian.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde/attachments/20031024/efbf834c/attachment.sig>
-------------- next part --------------
___________________________________________________
This message is from the kde mailing list.
Account management:  http://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


More information about the kde mailing list