Escaping regex + character

Arran Cudbard-Bell a.cudbardb at freeradius.org
Fri Aug 23 10:35:50 CEST 2013


On 22 Aug 2013, at 23:02, Franks Andy (RLZ) IT Systems Engineer <Andy.Franks at sath.nhs.uk> wrote:

> evluation

Well at least it'll evaluate instead of evluate now.

In the regex below it's not complaining about the lack of escaping.

It's complaining that _-+ or _-\ is not a valid range (I honestly can't remember if FR and PCRE both consume backslashes where the subsequent char doesn't need to be escape), which I believe is correct.  You can only specify ranges of numbers or letters, not symbols.

If you want to specify symbols you have to specify them individually or use one of the predefined sets.

Or if you shift that hyphen one to the right, it'll probably work OK too :)

For future reference those regex compilation errors are coming from the PCRE library, so you can look at the char offset after the first / to see where the error is occurring.

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team



More information about the Freeradius-Users mailing list