Re: [Templates] ttree not ignoring
[prev]
[thread]
[next]
[Date index for 2005/05/23]
Dave Howorth <dhoworth@xxxxxxx.xxx.xx.xx> writes:
> Harald Joerg wrote:
>> [...] However, \b
>> doesn't match at the beginning of a string.
>
> That's not quite right. From perldoc perlre:
>
> "A word boundary (\b) is a spot between two characters that has a \w
> on one side of it and a \W on the other side of it (in either order),
> counting the imaginary characters off the beginning and end of the
> string as matching a \W."
>
>> $ perl -e "print ('.svn/foo' =~ /\b\.svn/ ? 'match' : 'no match')"
>> no match
>
> perl -e "print ('svn/foo' =~ /\bsvn/ ? 'match' : 'no match')"
> match
>
> The problem is that a dot is not a word character, so there would have
> to be a \w BEFORE the \b for it to be a word boundary. The OP needs an
> separate test for the .svn case.
Thanks for the clarification. Silly me.
I just checked that the regex doesn't work as intended and then jumped
to a wrong conclusion.
--
Cheers,
haj
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates