Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
let test = 'a href="http://www.google.com">www.google.com</a;'
在 vimscript 中,如何http://www.google.com使用正则表达式摆脱这种情况,并将其存储在另一个变量中?
http://www.google.com
我似乎找不到任何关于此的文档。
let url = matchstr(test, '\ca href=\([''"]\)\zs.\{-}\ze\1') if empty(url) throw "no url recognized into ``".test."''" endif
有关更多信息,请参阅:
:h matchstr() :h /\c :h /\zs :h /\{-