在字符串中查找最后一个破折号后面的数字,因此:
test-123-2-456
将返回 456
123-test
将返回 ""
123-test-456
将返回 456
123-test-456sdfsdf
将返回 456
123-test-asd456
将返回 456
表达式@"[^-]*$"
并不匹配数字,我尝试使用[\d]
但是没有成功。