Xymon Mailing List Archive search

PCRE expression question

list Charles Goyard
Wed, 18 Apr 2007 17:54:00 +0200
Message-Id: <user-e52341ec4083@xymon.invalid>

Hi,

Galen Johnson wrote :
This works:

PORT "LOCAL=%[\.:](8611|8621|8631)$" state=LISTEN

But this doesn't...

PORT "LOCAL=%[\.:]86?1$" state=LISTEN 
I'm hoping fresh eyes will see what stupid thing I've missed...
That's because "?" matches 0 or 1 character, and applies to the 6. Try :

PORT "LOCAL=%[\.:]86[0-9]1$" state=LISTEN

(means 86 then some number, then 1, then end)

? has not the same meaning in pcre than in shell.

-- 
Charles Goyard - user-a6cdca7046e2@xymon.invalid - (+33) 1 45 38 01 31
Orange Business Services - online multimedia  // ingénierie