◆

WebStorm 正则替换常用技巧记录

2023-08-03 13:430

大小写转换

'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)

留言板

0 条留言
Markdown
0 字
对话记录每个声音,都值得被看见

对话,从你开始

还没有留言。分享一个想法,或只是打声招呼。

PAGE LOAD / LIVEWebStorm 正则替换常用技巧记录加载中