为什么.NET正EX pressions和Visual Studio的常规EX pressions之间的区别是什么? [英] Why the difference between .NET regular expressions and Visual Studio's regular expressions?

查看:150
本文介绍了为什么.NET正EX pressions和Visual Studio的常规EX pressions之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我终于找到引用了Visual Studio的的常规EX pressions的查找和替换和的 .NET的普通恩pression包,现在又出病态的好奇,我想知道:为什么差别

I've finally found references to both Visual Studio's regular expressions for Find and Replace, and .NET's regular expression package, and now out of morbid curiousity I want to know: why the difference!?

我敢肯定有技术上的,历史的,或可用性的原因,但它混淆了bajeepers [SP? ;-)]了我的第一次。

I'm sure there's a technical, historical, or usability reason, but it confused the bajeepers [sp? ;-) ] out of me at first.

推荐答案

我推测VS正则表达式的目的是匹配的 code 的很好,具有确定的许多方便的快捷键如:W 为整个单词,或:我的C ++标识符,或:Q 为带引号的字符串。

I'd speculate that the VS regexes are designed to match code well, having defined lots of handy shortcuts like :w for an entire word, or :i for a C++ identifier, or :q for a quoted string.

他们通常不需要处理任意的数据,你会需要环视断言和类似的东西了。或者至少说是较低的优先级列表中。

They usually don't need to handle arbitrary data that you'd need lookaround assertions and stuff like that for. Or at least that was lower on the priorities list.

这篇关于为什么.NET正EX pressions和Visual Studio的常规EX pressions之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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