如何排除Sublime文本Regex匹配和替换的字符
-
21-12-2019 - |
题
我有以下情况,我试图使用st正则表达式替换:
echo Street = $this->input->post('Street');
echo City= $this->input->post('City');
.
我想将每一行转换为:
echo City= trim($this->input->post('City'));
.
我使用的正则表达式是:
\$this(.+);
.
但这与包括最终的整个线相匹配'''
如何仅选择:
$this->input->post('City')
. 解决方案
试试这个:
\$this([^;]+)
.
[^;]
意味着什么,但分号: - )
其他提示
也许这就是你想要的
\$this([^;]+)
. =\s\$this(.+\')
应该管用。我不确定升华短信RE引擎细节。
不隶属于 StackOverflow