Unlang regular expression string expansion.

Alan DeKok aland at deployingradius.com
Thu Aug 23 11:49:18 CEST 2007


Arran Cudbard-Bell wrote:
> if(%{User-Name} =~ /%{Calling-Station-ID}/i){
> 
> Doesn't expand %{Calling-Station-ID} , but thats expected.

  It could... edit src/main/evaluate.c, look in function getregex(), and
change the final "return T_BARE_WORD" to "return T_DOUBLE_QUOTED_STRING"

  After all, if you can use variables in Perl's regular expressions, why
not here?

> Any chance of expanding regex strings before passing them to the regex
> parser ?

  A one-line patch.  It should probably go in, because it's just too
useful to leave out.

  Alan DeKok.




More information about the Freeradius-Users mailing list