当前位置: 动力学知识库 > 问答 > 编程问答 >

Eclipse regex for $_GET['whatever']

问题描述:

I would like to find replace this in eclipse:

find:

$_GET['whatever']

replace:

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

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: