【发布时间】:2019-05-09 01:52:19
【问题描述】:
尝试使用正则表达式查找和替换批量转换,但我不确定这是否可行,更不用说如何实现了。
使用 Sublime text 作为编辑器,如果可能,请打开其他工具来完成此操作。
两个示例行:
Session::flash( 'error', 'Only users with permission may view the directory user.' );
Session::flash( 'error', 'System user ID does not exist.' );
** 期望的结果:**
flash('Only users with permission may view the directory user.')->error();
flash('System user ID does not exist.')->error();
当前匹配的正则表达式:
Session::flash(\s*'error',.* )
是否可以保存文本行并在替换行中重复使用?希望有一个类似于 $variable 的解决方案,以便我可以用类似的东西替换字符串
** 如意行:**
flash('$variable')->error();
谢谢各位!
【问题讨论】:
标签: regex string replace sublimetext3