in reply to Fill Gaps

It's not clear what you want to achieve. Maybe the following Perl code will help? Just replace the text in the hash with whatever you want to fill the gaps with.

use strict; use warnings; my %fillers = ( A => "Whatever is required for the A gap here", B => "Whatever is required for the B gap here", C => "Whatever is required for the C gap here", ); while (<DATA>) { s/_*(\w)_+/$fillers{$1}/eg; print; } __DATA__ function start() { __A________________________________________________; } function validate( event ) { if ( B_____{ event.preventDefault(); C__________________; alert( "Wrong format for age!" ); } }

Prints:

function start() { Whatever is required for the A gap here; } function validate( event ) { if ( Whatever is required for the B gap here{ event.preventDefault(); Whatever is required for the C gap here; alert( "Wrong format for age!" ); } }

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Fill Gaps
by ww (Archbishop) on Nov 25, 2006 at 13:55 UTC
    given Joost's observations (++) and the reply from GrandFather (++), I nearly have to upvote and keep the OP (--) ...
        ... just so it remains as an object lesson!