◆

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

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

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