[a-zA-Z]+\\.(?<extension>\\w+)'[a-zA-Z]+': Match a single character present in the list below '+': Between one and unlimited times, as many times as possible, giving back as needed (greedy) 'a-z': A character in the range between "a" and "z" 'A-Z': A character in the range between "A" and "Z" '\\': Match the character "\" literally '.': Match any single character that is not a line break character '(?<extension>\\w+)': Match the regular expression below and capture its match into backreference with name "extension" '\\': Match the character "\" literally 'w+': Match the character "w" literally '+': Between one and unlimited times, as many times as possible, giving back as needed (greedy)
'\\': Match the character "\" literally '.': Match any single character that is not a line break character
^ 输入文本的开头 ^B B,但只能是文本中的第一个字符
$ 输入文本的结尾 X$ X,但只能是文本中的最后一个字符
. 除了换行字符(\n)以外的所有单个字符 i.ation isation、ization
* 可以重复0次或多次的前导字符 ra*t rat、raat等
+ 可以重复1次或多次的前导字符 ra+t rt、rat、raat等
? 可以重复0次或1次的前导字符 ra?t 只有rt和rat匹配
\s 任何空白字符 \sa [space]a,\ta,\na(\t和\n与C#的\t和\n含义相同)
\S 任何不是空白的字符 \SF aF,rF,cF,但不能是\tf
\b 字边界 ion\b 以ion结尾的任何字
\B 不是字边界的位置 \BX\B 字中间的任何X extension附加信息。
字符序列 等效字符类
. [^\n\r]
\s [#x20\t\n\r]
\S [^\s]
\i 初始名称字符,匹配字母 | '_' | ';'.
\I [^\i]
\c 名称字符(由 NameChar 匹配的那些字符)的集合。
\C [^\c]
\d \p{Nd}
\D [^\d]
\w [#x0000=#x10FFFF]-[\p{P}\p{Z}\p{C}](除标点、分隔符和其他字符的集合之外的所有字符)。
\W [^\w]
谢谢!!!!
如果是匹配文件名,那么这里是将文件的扩展名部分命名为extension。
'+': Between one and unlimited times, as many times as possible, giving back as needed (greedy)
'a-z': A character in the range between "a" and "z"
'A-Z': A character in the range between "A" and "Z"
'\\': Match the character "\" literally
'.': Match any single character that is not a line break character
'(?<extension>\\w+)': Match the regular expression below and capture its match into backreference with name "extension"
'\\': Match the character "\" literally
'w+': Match the character "w" literally
'+': Between one and unlimited times, as many times as possible, giving back as needed (greedy)
'.': Match any single character that is not a line break character