0

我正在使用 C# 正则表达式。

我如何匹配(任何较低的上部和/或 &)

A & E    ==> Should leave this as is
a & e    ==> Should leave this as is

而不是这个

A &#1234 B ==> Should convert to A B

A&#1234 B ==> Should convert to A B
4

1 回答 1

0

看起来您真的只想从字符串中删除 &#Digit?

new Regex(" ?&#[0-9]+").Replace("A&#1234", "")
于 2012-04-07T07:21:11.750 回答