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

Home » Public Forums » archive » Re: bug in stregex?
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: bug in stregex? [message #31529 is a reply to message #31526] Fri, 19 July 2002 15:16 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Vapuser <vapuser@catspaw.jpl.nasa.gov> writes:
> I don't you, you tell me. Is this a bug?
>
> IDL> tt=stregex('cdefaz',"(.*)(a|b|c)z",/extract)
> IDL> help,tt
> TT STRING = 'cdefaz'
>
> My understanding of regular expressions says it's a bug. The first
> '(.*)' should only match up to the 'a' and the second subexpression,
> since it is *unqualified*, should handle the 'az', i.e. TT should
> have two parts. tt[0] should be 'cdef' and tt[1] should be 'a.'

Hi--

Why don't you try the /SUBEXPR keyword? That seems to do the trick.

IDL> print, !version
{ x86 linux unix 5.4 Sep 25 2000 32 32}
IDL> print, stregex('cdefaz',"(.*)(a|b|c)z",/subexpr, /extract)
cdefaz cdef a

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: where are the user defined macros saved?
Next Topic: Urgent help! Could anyone send me a simple algorithm for Maximum Intensity Projection(MIP)?

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

Current Time: Fri Oct 10 19:24:30 PDT 2025

Total time taken to generate the page: 1.04221 seconds