Regex match on a variable is not working if length is long
Arran Cudbard-Bell
a.cudbardb at freeradius.org
Wed Dec 11 15:00:46 CET 2019
> On 11 Dec 2019, at 20:48, Alan DeKok <aland at deployingradius.com> wrote:
>
> On Dec 11, 2019, at 4:06 AM, Chinnapaiyan, Nagamani <Nagamani.Chinnapaiyan at viasat.com> wrote:
>> This one works,
>>
>> (6) if ( "%{control:Tmp-String-7}" =~ /vendor-options.*\(number 43\)\(value (([0-9a-fA-F]{2}:)*[0-9a-fA-F]{2})/ ) {
>
> One possibility is to fix the expression. You're not using the capture groups, so there's no need to the regex engine to store them.
>
> You should be able to use:
>
> if (&control:Tmp-String-7 =~ /vendor-options.*\(number 43\)\(value (?:(?:[0-9a-fA-F]{2}:)*[0-9a-fA-F]{2})/ ) {
or it'd be:
if (&control:Tmp-String-7 =~ /vendor-options.*\(number 43\)\(value ((?:[0-9a-fA-F]{2}:)*[0-9a-fA-F]{2})/ ) {
if you wanted to extract the value still.
I've pushed a change to increase the JIT stack size, and added string output for the extra error codes, but disabling the inner capture group as Alan suggested, will likely fix the issue.
-Arran
Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
More information about the Freeradius-Users
mailing list