[英]RegEx: Switch from ANSI C++ style open braces (new line) to K&R style (same line as the statement)
Search for \\n[ \\t]*\\{\\n
and replace with {\\n
or with {\ \
if you want to preserve the Windows-style line endings (CR+LF). 搜索
\\n[ \\t]*\\{\\n
,如果要保留Windows样式的行尾(CR + LF),则替换为{\\n
或{\ \
。 Note the space in front of the brace for the replace pattern. 请注意在括号前面的替换模式的空间。
Explanation: match a new line followed by series of spaces and/or tabs, an open brace and another new line. 说明:匹配一个新行,然后是一系列空格和/或制表符,一个大括号和另一个新行。 Replace with a space, open brace and new line.
用空格代替,打开大括号并换行。
Worked with "Quick Replace" in Visual Studio 2010. 在Visual Studio 2010中使用“快速替换”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.