[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: Tk800.018 patch for possible perl 5.005_63 RE bug



David Dyck <dcd@tc.fluke.com> writes:
>>
>> Regular expressions of the form m#(?:^|/)(\w+)#
>> i.e. word at start of string or after a /.
>> This messes up appname setting, and one or two other things.
>
>Thank you Nick,
>  (I've cc'ed p5p - maybe they can add some test cases
>   to perl for this)

That one was known fixed in 5.005_64-to-be  

>
> I've used Perl since perl version 3, but I've never put
>the ^ in the middle like that -- I'm still learning new
>things.  (I just searched man perlre, and all the ^ characters
>that are not in a range or character class seem to be a the beginning of 
>the match, no wait, there is one in the `(?!pattern)' section
>but thats the |^, not ^|

Same idea - these are "regular expressions" so they should be regular.
It just happens that unless ^ can match at the begining of the string it won't
match - so it seldom gets deep. But (^|/) deal is widely used 
I 1st saw it in a 'mirror' exclude list.

>
>Would this alternative re work instead:
>    m#^(?:.*/)?(\w+)#

There are alternatives sure - but old Tks will not have them and 
5.005_63 is just an alpha - alpha's have bugs but they get fixed.

-- 
Nick Ing-Simmons


References to:
David Dyck <dcd@tc.fluke.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]