regular expression error in 3.0.x not present in 3.0.6

Aaron Hurt ahurt at
Fri Mar 6 17:25:34 CET 2015

The regexp will not compile with just 2 backslashes it seems to translate \\ to \ (correct) and then escapes out the following ] (not correct)

Things do work however with 4 backslashes \\\\ in the policy.d configuration and oddly enough it also works with 3 backslashes \\\ … am I missing something here as to how correct_escapes is supposed to function?

This isn’t really an issue as I can make it work and get the expected behavior.

with correct_escapes = true

In policy.d file:

simple_nt_regexp = "^([^\\]*)\\(.*)$”

In radiusd -X output:

/etc/raddb/policy.d/strip-user-domain[9]: Invalid regular expression:
/etc/raddb/policy.d/strip-user-domain[9]: ^([^\]*)\(.*)$
/etc/raddb/policy.d/strip-user-domain[9]:               ^ Pattern compilation failed: missing terminating ] for character class

> On Mar 6, 2015, at 10:08 AM, FreeRadius developers mailing list <freeradius-devel at> wrote:
>> On Mar 6, 2015, at 3:11 AM, Phil Mayers <p.mayers at> wrote:
>> On 5 March 2015 17:40:51 GMT+00:00, Aaron Hurt via Freeradius-Devel <freeradius-devel at> wrote:
>>> When old style domain names come into FR they seem to always contain
>>> two backslashes ‘DOMAIN\\username’
>> That's just a printout escaping thing in debugging. It's really one \ in the packet, and thus \\ is sufficient to match it in the regex with correct escapes set to true.
> Good to know, thank you.
>> --
>> Sent from my mobile device, please excuse brevity and typos
>> -
>> List info/subscribe/unsubscribe? See
> -
> List info/subscribe/unsubscribe? See

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <>

More information about the Freeradius-Devel mailing list