我正在使用 Visual Studio 2010 中的“查找和替换”功能来更改字段的编码样式。
所有实例都类似于
m_MyField
应该是
_myField
但我只能设法得到
_MyField
使用
Find what: m_{[a-zA-Z]}
Replace with: _\1
如何让第一个字母小写?我尝试了以下但它不起作用:
Find what: m_{[a-zA-Z]}
Replace with: _\L\1
我在 http://vim.wikia.com/wiki/Changing_case_with_regular_expressions 中找到了解释但我认为它只适用于 vim。
欢迎提出任何建议。
最佳答案
我会使用这种方法:
Find what: m_A{[a-zA-Z]}
Replace with: _a\1
并为 B..Z 重复它
不优雅,但应该快速完成。
关于regex - 在 Visual Studio 2010 中使用正则表达式查找和替换小写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13601381/