Dave Howorth <[EMAIL PROTECTED]> 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
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to