regex to match non-whitespace OR space prefixed with '\\'

后端 未结 3 1795
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-14 15:08

I have a space delimited list of files names, where spaces in the file names are prefixed by \'\\\'

e.g. \"first\\ file second\\ file\"

How can I get my rege

3条回答
  •  难免孤独
    2021-01-14 16:00

    (\\ |[^ ])+
    

    Everything except spaces, except when they're escaped. Should work, sorry for misunderstanding your question initially.

提交回复
热议问题