【发布时间】:2021-03-31 15:54:52
【问题描述】:
我有这个模式
@"($\w+)"
它会成功捕获 $substring 内的 long text $substring the rest of the text。
但在某些情况下会失败,例如some string $sub.string the rest of string只会返回$sub
如何从字符串中获取实际的完整子字符串?
【问题讨论】:
-
你可能有
@"\$\w+",你想要\$\S+。 -
@WiktorStribiżew 如果您发布完整回复,我可以将其标记为已解决。