我对在 VB.net 中使用 RegExes 一无所知,但是像这样的字符串
^[A-Z]:\\[0-9]{0,4}_(.+)\\.*$
应该提供一个很好的起点。反斜杠用反斜杠转义;)。究竟是什么决定了 blah_blah 部分的开始和结束?我猜它是下划线和尾随 \ ?在我的正则表达式示例中, () 包含 blah_blah。
^ start of line
[A-Z] one upper case letter
:\\ followed by a colon and a backslash
[0-9]{0,4} followed by up to four digits between 0-9 (tweaking here might be necessary)
_ followed by an underscore
(.*) followed by at least one (+) arbitrary character
\\ followed by a backslash (again, escaped maybe you don't need this)
.*$ followed by any number of characters until the end of the line ($)
如果您对模式有更多了解,您应该考虑编辑您的问题以使其更清晰。blah_blah 部分是否只有字母等?