Regular expression in postauth section

Alexander Clouter alex at
Tue Jun 29 09:21:46 CEST 2010

JOE <joeplc at> wrote:
> Thanks Alan, I meant something like this:
> post-auth {
>        if(!(User-Name=="test-user")){
And this is *still* not regex.  The following is regex:
if (Calling-Station-Id =~ /^([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})-([0-9a-f]{2})$/i) {
	update control {
		MAC-Address-Trimmed := "%{1}%{2}%{3}%{4}%{5}%{6}"

For a tutorial on what and how to use regex, look at:

man 7 regex -

Always remember though, 'regex != perl regex', so do not mix up your 
tutorials.  Also there is a thing known as 'extended' regex, known in
POSIX.2 as 'modern RE', and also there is 'basic RE' that are obsoleted.


Alexander Clouter
.sigmonster says: Please come again.

More information about the Freeradius-Users mailing list