Re: [Templates] ttree not ignoring

[prev] [thread] [next] [Date index for 2005/05/23]

From: Harald Joerg
Subject: Re: [Templates] ttree not ignoring
Date: 16:10 on 23 May 2005
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

[Templates] ttree not ignoring
Steve Kelem 22:21 on 20 May 2005

Re: [Templates] ttree not ignoring
Harald Joerg 12:26 on 23 May 2005

Re: [Templates] ttree not ignoring
Dave Howorth 14:49 on 23 May 2005

Re: [Templates] ttree not ignoring
Harald Joerg 16:10 on 23 May 2005

Re: [Templates] ttree not ignoring
Vivek Khera 14:43 on 23 May 2005

Generated at 15:56 on 25 May 2005 by mariachi v0.52