Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

substituting the pound sign

Status
Not open for further replies.

calabama

Programmer
Feb 19, 2001
180
0
0
US
Greetings,

How do I go about substituting the pound sign?

my $OLDSTUFF1 =~ s/##/ /g;

Thanks

Cal

In the begining
Let us first assume that there was nothing to begin with.
 
Standard rule with regular expressions: If it is special without an escape, add one. If it is not special without an escape, leave as is.
 
That poses a question I've have many times before? What exactly are all the special characters? I escape everything that's questionable but I'm always told "Hey, why did you escape that? you don't need to
 
Anything that the regex interpreter wants to interprete must be escape to be viewed literally.

The problem you are having is that the regex interpeter is context sensitive. In some contexts things are literal in others they are not.


is a good place to start. From my perspective it has a lot to do with experience although the O'Reilly Regular Expressions books is very handy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top