mojeime
mojeime

Reputation: 13

Eclipse regex for $_GET['whatever']

I would like to find replace this in eclipse:

find: $_GET['whatever']

replace: $this->input->get('whatever')

Upvotes: 1

Views: 168

Answers (1)

jolo
jolo

Reputation: 771

Try this. You have to make sure you have regular expressions turned on in the Find/Replace window.

Find: \$_GET\[('.*')\]
Replace: \$this->input->get($1)

It's not clear to me what your 'whatever' needs to be. If it's only word characters you can replace the .* with \w. You have to precede the dollar sign and the left and right brackets with a backslash (escape them) because they are special characters in the regex and if not escaped would be treated differently by the regex parser.

Good luck.

Upvotes: 2

Related Questions