Substring using Unlang?

Peter Lambrechtsen peter at crypt.co.nz
Sat Jul 13 01:52:25 CEST 2013


On Sat, Jul 13, 2013 at 11:36 AM, Arran Cudbard-Bell
<a.cudbardb at freeradius.org> wrote:
>
> On 13 Jul 2013, at 00:14, Peter Lambrechtsen <peter at crypt.co.nz> wrote:
>
>> On Wed, Jul 10, 2013 at 6:34 PM, Olivier Beytrison
>> <olivier at heliosnet.org> wrote:
>>> On 10.07.2013 07:48, Olivier Beytrison wrote:
>>>> if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) {
>>>
>>> if ( ADSL-Agent-Remote-Id =~ /(.{1,32})$/ ) {
>>>
>
> Though you know you're not specifying offset and length, so you didn't need to increment the second number ;)

Yep... Once my brain kicked back into thinking regex it all came back
so 1,31 is the right one for us :)

IMHO those sorts of use cases really should be logged in the unlang
wiki or have a generic "regex examples" wiki page as those sorts of
problems come up all the time and it would be nice to direct people to
one place that has a lot of good re-usable examples.

Might go create a page when I have some downtime in the next few weeks.


More information about the Freeradius-Users mailing list