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

Regex single quotes and apostrophe 1

Status
Not open for further replies.

dmazzini

Programmer
Jan 20, 2004
480
US
Hi guys

Quick question:

How Can I replace single quotes and apostrophe for spaces.?

it does not work for me........
Code:
$bts_location= qq(AT  `T Lockwood at I-10);
#$bts_location=qq(Crown-Hardy '  Little York);

$bts_location=~s/\\`//g;   
print "BTS:$bts_location\n";








dmazzini
GSM/UMTS System and Telecomm Consultant

 
That looks like a backtik not an single-quote. There is no space on the replacement side of your regexp?

Anyway, use tr/// it is considerably more efficient:

Code:
$foo =~ tr/'`/ /;

As far as I know a single-quote and an apostrophe are the same thing.



------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
If I understand your gaol then try this:

$bts_location=~s/`/ /g;

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Hi Kevin

You right, I did not have any space / / ....:-(

Good cath!

Thanks

dmazzini
GSM/UMTS System and Telecomm Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top