我正在搜索与最后一个和之间的值匹配的正则表达式\
_
例子:
输入:\\\ezbe.local\folder1\folder2\folder3\33248a-48596-a54qsd-4d7d98_2
输出:33248a-48596-a54qsd-4d7d98
那将是
[^\\]*(?=_[^\\]*$)
解释:
[^\\]* # Match any number of non-backslash characters
(?= # if the following is true after the matched text:
_ # There is a _
[^\\]* # followed only by non-backslash characters
$ # until the end of the string.
) # End of lookahead assertion