in reply to Re: Replacing text - problem with $1 variable
in thread Replacing text - problem with $1 variable

Woohoo! It works when changing " to '. Thanks! :)

What I'm trying to do is replacing some code in some php-files from $_GET["whatever"] to get("whatever) and $_POST["whatever"] to post("whatever") so I can make some functions that handles all http-arguments with special characters like ζψεφό by converting them to html-tags like ø

Martin

Replies are listed 'Best First'.
Re: Re: Re: Replacing text - problem with $1 variable
by Hutta (Scribe) on Sep 03, 2003 at 12:33 UTC
    perl -pi -e 's/\$_(GET|POST)\[([^\]]*)]/lc($1) . "($2)"/egm;' test.php
    Assuming there's no nested square brackets inside your argument list to $_GET[] and $_POST[], that will work.