◆
WebStorm 正则替换常用技巧记录
大小写转换
'UPDATE_TEST' -> 'update_test'
find
('|[a-z|_]*';)
replace
\L$1
示例一
dispatch('test', { test1, test2 }) -> this.test({ test1, test2 })
- find:dispatch('([\w]+)', \s*([().,[]|{}\w\d\s":]+));
- replace:this.$1($2)
示例二
commit(TEST, code) -> thisTEST
- find: commit(([\w\d_]+), \s*([().,[]|{}\w\d\s":]+));
- replace: this$1
_(\w)

还没有留言,来发表第一条吧~