Case-insensitive regexps in rlm_files

Brian Candler B.Candler at pobox.com
Thu Nov 18 16:08:48 CET 2010


In rlm_files, I can't see how to make a case-insensitive regular expression.

-----------------------------------------------------------------
DEFAULT	User-Name =~ "(?i:foo)"
	# nope, not supported by POSIX ERE. Logs:
 	# "Invalid regular expression (?i:foo)"

DEFAULT User-Name =~ /foo/i
	# actually matches the character sequence "/foo/i"
-----------------------------------------------------------------

Am I missing a trick here?

If I make a patch for this, would you prefer the first or second to be
implemented?  The second is nicer to use, but is probably harder to
implement.

The first could be done as a frig by stripping off an outer (?i:  ...  )
and setting the REG_ICASE flag if seen.

Regards,

Brian.



More information about the Freeradius-Users mailing list