javasharp's recent timeline updates
javasharp

javasharp

V2EX member #118389, joined on 2015-05-23 15:18:26 +08:00
一只低调的菜鸟程序猿。
javasharp's recent replies
Aug 22, 2015
Replied to a topic by javasharp 程序员 正则替换的使用
Find: (?<=")(\w*)([A-Z])([a-z]+)(\w*)(?=")
Replace: $1_\U$2$3$4
一直重复以上替换操作,直至全部替换完毕

最后,删除字段前的下划线
Find: (?<=")_(\w+)(?=")
Replace: $1

也没有想出更优雅的做法,就这样了。
Aug 22, 2015
Replied to a topic by javasharp 程序员 正则替换的使用
@joyeblue 感谢回答。。不过,字段很多,有长有短,这样写法,似乎不太妥。
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2581 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 09:05 · PVG 17:05 · LAX 02:05 · JFK 05:05
♥ Do have faith in what you're doing.