Berkeley CSUA MOTD:Entry 28448
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2003/5/15 [Computer/SW/Languages/Perl] UID:28448 Activity:high
5/15    Perl regular expression question:
        I have a list of strings that I want to remove from a file.
        I tried to use s/$string//g for each string, but had problems
        when the $string contained special characters like (, /, etc.
        Is there a way to quote the $string so it will work?  I tried
        qr, but that didn't do the trick.
        \_ s/\Q$string\E//g