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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

matching special characters

Status
Not open for further replies.

stort

Programmer
Feb 17, 2006
10
0
0
GB
hi,

is it possible to match the following characters in perl?
/
*
\

I would like to remove all lines from a file if any of the above characters exist, but obviously they are special pattern matching characters.

any ideas?

cheers

Stort
 
Absolutely, just precede each with a backslash in the regex.
 
I thought i tried that, but was putting \s for whitespace and forgot to put \s* for multiple whitespace

it now works a treat

thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top