Hi!
I have a problem with search(); I try to match a contact header with IP address:
if !(search("Contact:.*@[0-9]+.[0-9]+.[0-9]+.[0-9]+:")) { works fine, whereas if !(search("Contact:.*@[0-9]+.[0-9]+.[0-9]+.\d+:")) { does not work. ^^
Looks like search() does not like \d Are there any known limitations for the regular expressions?
regards klaus
Hello,
On 08/04/05 12:57, Klaus Darilion wrote:
Hi!
I have a problem with search(); I try to match a contact header with IP address:
if !(search("Contact:.*@[0-9]+.[0-9]+.[0-9]+.[0-9]+:")) { works fine, whereas if !(search("Contact:.*@[0-9]+.[0-9]+.[0-9]+.\d+:")) { does not work. ^^
Looks like search() does not like \d Are there any known limitations for the regular expressions?
it should allow POSIX format. Is \d standard in POSIX? What OS are you using?
Daniel
regards klaus
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Daniel-Constantin Mierla wrote:
Hello,
On 08/04/05 12:57, Klaus Darilion wrote:
Hi!
I have a problem with search(); I try to match a contact header with IP address:
if !(search("Contact:.*@[0-9]+.[0-9]+.[0-9]+.[0-9]+:")) { works fine, whereas if !(search("Contact:.*@[0-9]+.[0-9]+.[0-9]+.\d+:")) { does not work. ^^
Looks like search() does not like \d Are there any known limitations for the regular expressions?
it should allow POSIX format. Is \d standard in POSIX? What OS are you using?
I use Linux Debian sarge. Looks like \d is not in posix: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html
But [:digit:] is there. I tested if !(search("Contact:.*@[0-9]+.[0-9]+.[0-9]+.[[:digit:]]+:")) { and it works.
klaus