in reply to Regex question

I don't know, but if all you want to do is make sure names are between 250 and 1000 chars then you are better off using length in a coderef :

$rule->name( {return 1 if ( (length >= 250) && (length <= 1000) ) } );

not tested!! Just an idea!

Just a something something...

Replies are listed 'Best First'.
Re^2: Regex question
by Win (Novice) on Aug 04, 2009 at 14:23 UTC
    Nice idea, however surely the regex parser in Perl would optimise to that anyway, wouldn't it?

    Update: Your method does however offer the advantage of allowing me to find file with a greater length. I'll just use the > 250 bit

      I don't know - I also don't know whether using .(dot) to match long strings like that would also be expensive, because of how many things could match such a 'loose' regex. But i am out of my depth here, i freely admit to not knowing enough about the inner workings of regexes...

      Just a something something...
Re^2: Regex question
by Win (Novice) on Aug 04, 2009 at 14:58 UTC
    btw. The following works. Your bit of code wasn't quite there. ;)

    $rule->name(length >= 250);
      Can't call method "name" on an undefined value at - line 1.