C# 正则表达式-文档
大家好,我正在通过一些旧代码,遇到了一个注册ex,我不知道它是做什么的,有人可以提供一些线索C# 正则表达式-文档,c#,regex,C#,Regex,大家好,我正在通过一些旧代码,遇到了一个注册ex,我不知道它是做什么的,有人可以提供一些线索 <(.|\n)*?>|{(.|\n)*?} {(.\n)*?} 它位于replace string.replace语句中。将正则表达式放入 底部是一个名为《你的正则表达式》的指南,根据RegexBuddy解释了它的作用: Match either the regular expression below (attempting the next alternative only if
<(.|\n)*?>|{(.|\n)*?}
{(.\n)*?}
它位于replace string.replace语句中。将正则表达式放入
底部是一个名为《你的正则表达式》的指南,根据RegexBuddy解释了它的作用:
Match either the regular expression below (attempting the next alternative only if this one fails) «<(.|\n)*?>»
Match the character “<” literally «<»
Match the regular expression below and capture its match into backreference number 1 «(.|\n)*?»
Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Note: You repeated the capturing group itself. The group will capture only the last iteration. Put a capturing group around the repeated group to capture all iterations. «*?»
Match either the regular expression below (attempting the next alternative only if this one fails) «.»
Match any single character that is not a line break character «.»
Or match regular expression number 2 below (the entire group fails if this one fails to match) «\n»
Match a line feed character «\n»
Match the character “>” literally «>»
Or match regular expression number 2 below (the entire match attempt fails if this one fails to match) «{(.|\n)*?}»
Match the character “{” literally «{»
Match the regular expression below and capture its match into backreference number 2 «(.|\n)*?»
Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Note: You repeated the capturing group itself. The group will capture only the last iteration. Put a capturing group around the repeated group to capture all iterations. «*?»
Match either the regular expression below (attempting the next alternative only if this one fails) «.»
Match any single character that is not a line break character «.»
Or match regular expression number 2 below (the entire group fails if this one fails to match) «\n»
Match a line feed character «\n»
Match the character “}” literally «}»
匹配下面的正则表达式之一(仅当此正则表达式失败时才尝试下一个替换)«»
匹配字符“»
或匹配下面第2个正则表达式(如果此正则表达式不匹配,则整个匹配尝试将失败)«{(.|\n)*?}
按字面上的«{»匹配字符“{”
匹配下面的正则表达式,并将其匹配捕获到反向引用编号2«(.|\n)*?»
在零次和无限次之间,尽可能少地按需扩展(惰性)«*?»
注意:您重复了捕获组本身。该组将仅捕获最后一次迭代。在重复组周围放置一个捕获组以捕获所有迭代。«*?»
匹配下面的正则表达式(仅当此正则表达式失败时才尝试下一个正则表达式)«。»
匹配不是换行符的任何单个字符«。»
或匹配下面第2个正则表达式(如果该正则表达式不匹配,则整个组将失败)«\n»
匹配换行符«\n»
按字面«}匹配字符“}”
比赛内容如下:
<>
<...>
{}
{...}
{}
{...}
当…是任何文本时你绝对应该点击@MaxS-真的很有趣!我喜欢当某人有一种优越感,他们必须抓住一切机会来炫耀,如果你不想回答这个问题,甚至认为这是一个愚蠢的问题,你应该干脆忽略它。对不起,冒犯了你。目的不是为了炫耀什么。即使这是一个(我承认很糟糕)的玩笑,提供的链接确实会让你找到一个非常好的工具来帮助你使用regex。我的评论是一种表达它在搜索和研究部分写了什么的方式。但再一次,对不起。谢谢,这太完美了