regex to match space but escaped space
Given a string: rsync -r -t -p -o -g -v --progress --delete -l -H
/Users/ken/Library/Application\ Support/Sublime\ Text\ 3/Packages
/Users/ken/Google\ Drive/__config-GD/ST3
regex to match space but escaped space I have tried:
Firstly to match escaped space(or any).
\\.
http://regex101.com/r/uL0mP8 works.
Next, to match space exclude the escaped space(or any).
(?!\\.)
http://regex101.com/r/fK3sW9 does not work.
What is wrong with the code? javascript.
Thanks
EDIT:
(?<!\\) http://regex101.com/r/fZ5uP2 wokrs!
I should have used neggative Negative Lookbehind...
No comments:
Post a Comment