conditional replacment with regexps?
Hi,
Suppose I have some text with a whole load of a's and b's, how can I create a regexp to replace the a's with b's and the b's with a's? |
sed 's/a/-=-TMP-=-/g; s/b/a/g; s/-=-TMP-=-/b/g'
But I guess tr 'ab' 'ba' should work. Yves. |
Suppose I was using emacs though?
|
All times are GMT -5. The time now is 01:56 AM. |