The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 12-10-2004
Lomic Lomic is offline
Registered User
  
 

Join Date: Dec 2004
Location: Paris
Posts: 20
Quote:
Originally posted by zazzybob
you can supress the interpretation of metacharacters by backslash escaping them...

e.g.
Code:
:%s/^.*my_patter_has_special_chars\*\/\$\^_in_it.*$//
As you can see, the .* at the beginning and end of line are still treated as metacharacters (as are the anchors).
ok but my_pattern_has_special_chars looks like
Code:
blabla 'toto' rep:/titi/toto/
so I protect it between #

if I understand what you mean, I should do like this:
Code:
:%s/^.*blabla\ \'toto\'\ rep\:\/titi\/toto\///
Am I right? (if it is the case, it si ok because my pattern never change)