正则表达式最后一次出现? [英] Regex Last occurrence?
本文介绍了正则表达式最后一次出现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图抓住最后一个反斜杠之后的最后一部分
我需要 \Web_ERP_Assistant
(带有\
)
I'm trying to catch the last part after the last backslash
I need the \Web_ERP_Assistant
(with the \
)
我的想法是:
C:\Projects\Ensure_Solution\Assistance\App_WebReferences\Web_ERP_WebService\Web_ERP_Assistant
\\.+?(?!\\) // I know there is something with negative look -ahead `(?!\\)`
但是我找不到它.
推荐答案
您的否定超前解决方案例如是这样:
Your negative lookahead solution would e.g. be this:
\\(?:.(?!\\))+$
这篇关于正则表达式最后一次出现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文