comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Extract numbers from text string
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Extract numbers from text string [message #75302] Tue, 22 February 2011 11:46
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 2/22/11 12:08 PM, nata wrote:
> Hi folks,
>
> Which is the best way to extract the numbers of the following string ?
> HELP, /MEM, OUTPUT=str
> PRINT, str
>
> I'm trying something like:
> str_out=STREGEX(str,'[0-9]*',/EXTRACT)
>
> But nothing happens...
> Any suggestions ? Thanks in advance,

Try using + instead of *:

IDL> print, str
heap memory used: 1302373, max: 1305378, gets: 1518, frees:
609
IDL> print, stregex(str, '[0-9]+', /extract)
1302373

Also, check out the MEMORY function.

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Extract numbers from text string
Next Topic: Avoiding multiple or complex WHEREs?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:38:47 PDT 2025

Total time taken to generate the page: 0.00534 seconds