I'm attempting to take an ldiff file and flip first/last name order. However I can not figure out how to match hyphenated last names. In vim, my current search/replace string is:

%s/cn=\(\w\+\-*\) \(\w\+\),/cn=\2 \1,/gc

This will match:

cn=Smith Joe,

and replace it with:

cn=Joe Smith,

But it will not match:

cn=Smith-Brown Joe,

nor replace it with:

cn=Joe Smith-Brown,

I've tried various incantations of escaping and quantifying yet I can not figure out how to do what I want.

Please show me my error.



Be a Great Magician!
Visit The Alchemist's Warehouse


freebsd-questions@freebsd.org mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to