在 Visual Studio 2010 中使用正则表达式查找和替换小写 [英] To lower case using Find and Replace with regular expression in Visual Studio 2010

查看:56
本文介绍了在 Visual Studio 2010 中使用正则表达式查找和替换小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2010 中使用查找和替换功能来更改字段的编码样式.

I am using the Find and Replace function in Visual Studio 2010 in order to change the coding style for fields.

所有类似的实例

m_MyField

应该是

_myField

但我只能设法得到

_MyField

使用

Find what:      m_{[a-zA-Z]}
Replace with:   _\1

如何使第一个字母小写?我已经尝试了以下但它不起作用:

How do I make the first letter lower case? I have tried the following but it does not work:

Find what:      m_{[a-zA-Z]}
Replace with:   _\L\1

我在 http://vim.wikia.com/wiki/Changing_case_with_regular_expressions 中发现了这一点但我认为它只适用于 vim.

I found this explained in http://vim.wikia.com/wiki/Changing_case_with_regular_expressions but it only works for vim I think.

欢迎提出任何建议.

推荐答案

我会使用这种方法:

Find what:      m_A{[a-zA-Z]}
Replace with:   _a\1

并为 B..Z 重复此操作

and repeat it for B..Z

不优雅,但应该尽快完成.

Not elegant but should be done quick.

这篇关于在 Visual Studio 2010 中使用正则表达式查找和替换小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆