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.
我想检索字符串末尾的数字序列。例如
string contentDbIndex = Regex.Match("ab56cd1234", @"\d+").Value;
给我结果56,但我希望结果为1234. 我该怎么做?
56
1234
您可以像这样使用结束锚( $):
$
string contentDbIndex = Regex.Match("ab56cd1234", @"\d+$").Value;