4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 String Substitution
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Thu Nov 06, 2003 8:30 pm (14 years ago) Reply with QuoteBack to Top

Dear friends,

I've got a problem with a substitution in Perl. I have a string ( let's supose $word) that can have values like the followings - it's impredictable:

asd3$( .ophG

wordļ Áhtn mnfbgd

@word_8 klMNBVFR 12

I want to extract only the character A to Z , a to z and 0 to 1 from the strings so I could have:

asd3 ophG

word Áhtn mnfbgd

word 8 kIMNBVFR 12


How can I do this?

Please answer as soon as possible - It's very urgent (again).

Best regards,

Kepler
OfflineView User's ProfileFind all posts by keplerSend Personal Message
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Fri Nov 07, 2003 10:47 am (14 years ago) Reply with QuoteBack to Top

$s = "stringwith some weirdochars";
$s =~ s![^\w\d]!!g;

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Sat Nov 08, 2003 4:18 pm (14 years ago) Reply with QuoteBack to Top

Hi,

it works like a charme...

Thank you,

Kepler
OfflineView User's ProfileFind all posts by keplerSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.048173 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme