What's wrong with this regex?
body PND_STOCK_PAYI /[^a-z](P[^a-z]{0,4}A[^a-z]{0,4}Y[^a-z]{0,4}I[^a-z]
Pay88)/i
(all on one line of course).
In SA3.2.5, I get the following message:
[5183] info: config: invalid regexp for rule PND_STOCK_PAYI: /[^a-z
(P[^a-z]{0,2}A[^a-z]{0,2}Y[^a-z]{0: missing or invalid delimiters
With SA3.1.7, there's no problem.
/Per Jessen, Zürich
Re: What's wrong with this regex?
> body PND_STOCK_PAYI[color=blue]
> /[^a-z](P[^a-z]{0,4}A[^a-z]{0,4}Y[^a-z]{0,4}I[^a-z]
> Pay88)/i
>
> (all on one line of course).
>
> In SA3.2.5, I get the following message:
>
> [5183] info: config: invalid regexp for rule
> PND_STOCK_PAYI: /[^a-z
> (P[^a-z]{0,2}A[^a-z]{0,2}Y[^a-z]{0: missing or invalid
> delimiters
>
> With SA3.1.7, there's no problem.
>
>
> /Per Jessen, Zürich[/color]
The regexp as shown is not the same as in the error message.
The code shows items like {0,4} while in the error message they are {0,2}
The code the last characters of the rule are "Pay88)/i", while in the regexp in error message has last characters as "[^a-z]{0".
The error is not from the regexp you think it is.
Re: What's wrong with this regex?
Per Jessen wrote:[color=blue]
> body PND_STOCK_PAYI /[^a-z](P[^a-z]{0,4}A[^a-z]{0,4}Y[^a-z]{0,4}I[^a-z]
> Pay88)/i
>
> (all on one line of course).
>
> In SA3.2.5, I get the following message:
>
> [5183] info: config: invalid regexp for rule PND_STOCK_PAYI: /[^a-z
> (P[^a-z]{0,2}A[^a-z]{0,2}Y[^a-z]{0: missing or invalid delimiters
>[/color]
This is the not the same regex ({0,2} vs {0,4}). you should copy-paste
the re and post it, as there are more eyes to spot a typo...
[color=blue]
> With SA3.1.7, there's no problem.
>
>
> /Per Jessen, Zürich
>[/color]
Re: What's wrong with this regex?
Jari Fredriksson wrote:
[color=blue][color=green]
>> body PND_STOCK_PAYI
>> /[^a-z](P[^a-z]{0,4}A[^a-z]{0,4}Y[^a-z]{0,4}I[^a-z]
>> Pay88)/i
>>
>> (all on one line of course).
>>
>> In SA3.2.5, I get the following message:
>>
>> [5183] info: config: invalid regexp for rule
>> PND_STOCK_PAYI: /[^a-z
>> (P[^a-z]{0,2}A[^a-z]{0,2}Y[^a-z]{0: missing or invalid
>> delimiters
>>
>> With SA3.1.7, there's no problem.
>>
>>
>> /Per Jessen, Zürich[/color]
>
> The regexp as shown is not the same as in the error message.[/color]
I assumed that was because the error-message cuts it short, but you're
absolutely right, I had another unfinished rule with the same name.
Thanks for making me look again.
/Per Jessen, Zürich
Re: What's wrong with this regex?
Per Jessen wrote:[color=blue]
> body PND_STOCK_PAYI /[^a-z](P[^a-z]{0,4}A[^a-z]{0,4}Y[^a-z]{0,4}I[^a-z]
> Pay88)/i
>
> (all on one line of course).
>
> In SA3.2.5, I get the following message:
>
> [5183] info: config: invalid regexp for rule PND_STOCK_PAYI: /[^a-z
> (P[^a-z]{0,2}A[^a-z]{0,2}Y[^a-z]{0: missing or invalid delimiters
>
> With SA3.1.7, there's no problem.
>
>
> /Per Jessen, Zürich
>
>
>[/color]
As the others have said, it's not the same regex. The one that isn't
working is missing a ']' after /[^a-z.
Re: What's wrong with this regex?
Per Jessen wrote on Fri, 18 Jul 2008 12:40:27 +0200:
[color=blue]
> [^a-z](P[^a-z]{0,4}A[^a-z]{0,4}Y[^a-z]{0,4}I[^a-z]
> Pay88)[/color]
Regex Coach doesn't complain about it, but don't you need a quantifier
after the first [^a-z] range?
Kai
--
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: [url]http://www.conactive.com[/url]
Re: What's wrong with this regex?
Kai Schaetzl wrote:[color=blue]
> Per Jessen wrote on Fri, 18 Jul 2008 12:40:27 +0200:
>[color=green]
>> [^a-z](P[^a-z]{0,4}A[^a-z]{0,4}Y[^a-z]{0,4}I[^a-z]
>> Pay88)[/color]
>
> Regex Coach doesn't complain about it, but don't you need a quantifier
> after the first [^a-z] range?[/color]
no, the default quantifier is {1,1}.
as said earlier, this RE is correct. the error is in another one.