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

Home » Public Forums » archive » Re: extracting numbers
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: extracting numbers [message #48028 is a reply to message #48026] Thu, 23 March 2006 06:34 Go to previous messageGo to previous message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
On Wed, 22 Mar 2006 kl_tah@hotmail.com wrote:
> Hi, does anyone happen to know how to extract a sequence of
> numbers (including the sign) between two characters? for eg. I
> have
>
> AAAA = -23.445 /BBBBB
> and could like to extract the number between '=' and '/'

IDL> print, stregex(string, "[0-9.\-]+", /subexpr, /extract)

works in the example above. More generally, removing all letters
would be this:

IDL> print, stregex(string, "[^a-zA-Z]+", /subexpr, /extract)

But you get the = and the trailing "/".

IDL> print, stregex(string, "[^\ \=a-zA-Z\/]+", /subexpr, /extract)

removes all spaces, equals, letters, and / characters...

-k.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Envi display bands
Next Topic: Azimuth and Offset XYZ position correction

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

Current Time: Tue Dec 02 20:53:56 PST 2025

Total time taken to generate the page: 1.20047 seconds