Kapila Kohli wrote:
> Hi,
> I am new to Template editing. Currently working on editing
> Bugzilla/Template/comments.html.tmpl.
> I would like to add a code for pattern:-
>
> FILES CHECKED IN:
> orion/WEB-INF/src/com/mmt/hotels/seo/beans/Video.java NONE 1.1.2.1
> orion/WEB-INF/src/com/mmt/hotels/seo/beans/Review.java NONE 1.1.2.1
> orion/WEB-INF/src/com/mmt/hotels/seo/beans/Area.java NONE 1.1.2.1
> orion/WEB-INF/src/com/mmt/hotels/seo/beans/CategoryHotel.java NONE
> 1.1.2.1
> etc etc
>
> Make Filename, revision a hyperlink.
[SNIP]
> [% IF
> text.match('/([\w./]+)[\s|\n]+([\d.]+|NONE)[\s|\n]+([\d.]+|NONE)/g') %]
> [% SET @matches = ' value ' %]
> [% text= text.replace(' value ','<a
> href="$reponm/$value[con]">$value[con+]</a>') %]
> [% con++ %]
> [% END %]
>
> [%- text -%]
> </pre> </div>
> [% END %]
>
> But it doesn't seem to be working,can anyone help me on this?
> Thanks in advance.
> Regards
[SNIP]
Please don't reply to a previous email when creating a new thread. Just send to
the mailing list address.
I think you are going to have a very rough go at this as your entire example is
riddled with problems. I would suggest reading through the manual as much as
possible.
Anyhow, match doesn't use the //g. It only takes a string. So you'll need to
drop the two slashes and the g.
ie: '([\w./]+)[\s|\n]+([\d.]+|NONE)[\s|\n]+([\d.]+|NONE)'
Here is the documentation for that:
http://template-toolkit.org/docs/manual/VMethods.html#method_match
One other thing. Your [\w./] will not include the dash in WEB-INF in the
original text either, since \w does not include a dash.
There are other errors here too including using @matches = '' as well as your
replace text which is trying to do string substitution inside of a single quote
rather than a double quote. Maybe you just need the match to work before you
can begin testing that out.
-- Josh
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates