Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Perl
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Perl section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2007, 10:52 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Does anyone know a way i can pick out only numbers

Does anyone know a way i can pick out only the numbers from a string?
string examples....
TEX12900
UH8900
FloNumber899090
YB28999

I only want, say,....
12900
8900
899090
8999

Thanks,
Picco

www.crmpicco.co.uk
www.ie7.com
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old March 15th, 2007, 05:37 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

$_=~s/\D//g; ?

--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
 
Old March 15th, 2007, 08:57 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Code:
my ($outno) = $returned->{outno} =~ /(\d+)/;
thanks, this works......

www.crmpicco.co.uk
www.ie7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to pick up a declaration from a node ramesh.kumarm XSLT 3 March 8th, 2006 12:40 AM
pick text apart darkhalf Beginning PHP 7 March 12th, 2004 04:15 PM
Parameter Pick List tektek Crystal Reports 0 January 6th, 2004 05:08 PM
pick file from unix vakil Biztalk 1 July 9th, 2003 04:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.