Mon, 28 Jun 2004, by k.lelong@ace-electronics.be:
Theo v. Werkhoven wrote:
Wed, 23 Jun 2004, by k.lelong@ace-electronics.be:
....
There is a very nice tool for that called 'pcretest' $ pcretest PCRE version 4.4 21-August-2003
I'm going to look into this, but has pcre the same syntax as regexp ? As far as I could understand by reading the regexp man pages, the ! means 'not', inversion of the following rule. Maybe I forgot some brackets.
Pcre (Perl Compatible Regular Expression) is an extension of the normal regexp library, comparible to Extended regexp. It knows expressions like \d for 'decimal number', \w for word, \s for 'whitespace' etc. From what I see in re_syntax(n) '!' to negate is only used in constraint matches: A constraint matches an empty string when specific condi tions are met. A constraint may not be followed by a quantifier. The simple constraints are as follows; some more constraints are described later, under ESCAPES. (?!re) negative lookahead (AREs only), matches at any point where no substring matching re begins I couldn't find this function in the pcre explanation in /usr/share/doc/packages/pcre/html/pcrepattern.html btw. In bracket expressions a '^' is used to negate a search: BRACKET EXPRESSIONS A bracket expression is a list of characters enclosed in `[]'. It normally matches any single character from the list (but see below). If the list begins with `^', it matches any single character (but see below) not from the rest of the list. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 27N , 4 29 45E. + ICQ: 277217131 SUSE 9.1 + Jabber: gurp@nedlinux.nl Kernel k_athlon-2.6.4 + MSN: twe-msn@ferrets4me.xs4all.nl See headers for PGP/GPG info. +