净正则表达式:什么是单词字符\ W? [英] .Net regex: what is the word character \w?

查看:591
本文介绍了净正则表达式:什么是单词字符\ W?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单问题:
什么是模式的单词字符 \ W 在C#,. NET?

Simple question:
What is the pattern for the word character \w in c#, .net?

我首先想到的是它匹配 [A-ZA-Z0-9 _] 文档告诉我:

My first thought was that it matches [A-Za-z0-9_] and the documentation tells me:


Character class    Description          Pattern     Matches
\w                 Matches any          \w          "I", "D", "A", "1", "3"
                   word character.                  in "ID A1.3"

这是不是非常有帮助。
\ W 似乎符合 AOU ,太。还有什么?有没有更好的(精确)的定义可用?

which is not very helpful.
And \w seems to match äöü, too. What else? Is there a better (exact) definition available?

推荐答案

文档

\ W 匹配任何单词字符。单词字符是任何的下表中列出的统一code类会员。

Word Character: \w

\w matches any word character. A word character is a member of any of the Unicode categories listed in the following table.

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