Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
[代码]> 10 /td>[/代码]
我想从这条线上得到 10 个。但我需要保留模式。我怎样才能写出一个表达式:
, 换行符, ignorewhitespace OR 包括不确定的空格, 10, ignorewhitespace OR 包括所有空格, /td
谢谢,乔·K。
好的,这次我会很好地帮助你。=)
我假设您要查找的号码可以更改。
var result = Regex.Match( "[code]> 101 /td>[/code]", @"(?<=\>\s*)\d+(?=\s*/td\>)").Value;
但是,请下次尝试这样做......我会为您指出一个可以帮助设计和学习正则表达式的工具:
http://www.radsoftware.com.au/regexdesigner/