\t\tmy($page)=&create_page(isitvalid("templatefile.html"),\%replace,\%lists,@unhide); #### s/^\W* # we may have some white space at start of line my\W*? # all variable will use my \(? # variable may or may not be list \W*? # some people space out the parens and some don't \$page # assuming for now that page is always the variable \W*? # more possible space around parenthesis \)? # variable may or may not be a list \W*? # whitespce is optional = # we have to assign the variable \W*? # more optional whitespace \&? # function may or may not be explicitly contexted create_page\W*? # the name of the funciton followed by optional space \( # parenthesis begins the parameterlist \W*? # we might have whitespace before first parameter ([^,]*?) # BROKEN: this should collect everything up to the next comma in variable number 1 \W*? # this shouldn't be necessary since whitespace should have been slurped on previous line but this shouldn't hurt either , # Got to have the separator \W*? # more optional whitespace ([^,]*?) # NOT BROKEN: this grabs everything up to the second comma (of course we don't have parens and dblquotes in second param \W*? # this shouldn't be necessary since whitespace should have been slurped on previous line , # Got to have the separator \W*? # more optional whitespace ([^,]*?) # NOT BROKEN: third one gets gotten fine as well \W*? # again the unnecessary whitespace collector , # Again the seperator \W*? # Again the optional whitespace ([^)]*?) # NOT BROKEN: heres our final collection point \W*? # Again with the unnecessary whitespace \) # our parameter list has come to a close \W*? # whitespace might seperate from closing punctionation though it seems unlikely ; # closing punctuation ends the statement the replace doesn't matter for the question /my \$renderer = new HRsmart::Lightning::Render ( template => $1,\n\t\tloops => $3,\n\t\treplace => $2,\n\t\tfinals => $4 );\n\$renderer->customize_header\( \$company_id \);\nmy \$page = \$renderer->render;\n\$page =~ s\/~%.{0,20}%~\/\/g;\n/gx;