what about smth like this (I may not be exact about the regexp syntax, but 
you should get the idea:

        (#if\w*\(.+=.+\)\w*){([^}]*)}
replace with:
        $1$2#end

should work in most cases

and similar for #foreach...

Fedor.

On Monday 07 May 2001 23:48, you wrote:
> I did a bunch of work on the WM -> VTL conversion process today, and
> finally ran the converter against the Helm templates again.  I
> definitely made some progress, but all of our templates use the curly
> brace syntax and all contain indented WM markup.  Due to JavaScript
> worries, we are missing at least half of the #end VTL directives that
> should be in the shiny new VTL templates that the converter leaves
> behind:
>
>         // Change the "}" to #end. Have to get more
>         // sophisticated here. Will assume either {}
>         // and no javascript, or #begin/#end with the
>         // possibility of javascript.
>         "\n}", // assumes that javascript is indented, WMs not!!!
>         "\n#end",
>
> I've had it for the evening, but would love to hear some ideas on
> improving the conversion program to the point where it has a chance of
> dealing with indented closing curly braces.  Worst case scenario, I can
> run a Perl regex across all the templates to pull the closing curly
> flush with the start of its line.  However, I would rather improve the
> conversion program--not everyone is fortunate enough to be able to avoid
> JavaScript as our templates seem to have done.  Thanks!

Reply via email to