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

Home » Public Forums » archive » Re: IDL input files.
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: IDL input files. [message #54520] Mon, 18 June 2007 17:27 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jun 18, 4:19 pm, ryans...@gmail.com wrote:
> On Jun 18, 3:23 pm, Paul van Delst <Paul.vanDe...@noaa.gov>
>> On a side note, I initially started using regular expressions with the STRSPLIT function
>> only to discover IDL seems to use a hamstrung version that doesn't understand stuff like
>> \s, \w, \n, etc. For the format you list, e.g.
>
>> Name = {Joe}
>> Department = {CS}
>> Age = {25}
>
>> regexps would be the go (IMO) - although I don't see any mention of how you would capture
>> certain parts of a match and not others (but I didn't look too hard :o)


I'm just catching this at the end, but I think this would be useful
for you:

IDL> results = stregex(line, '([[:alnum:]]*) = \{([[:alnum:]]*)\}', /
extract, /subexpr)
IDL> print, results[0]
Name = {Joe}
IDL> print,
results[1]
Name
IDL> print, results[2]
Joe

IDL regular expressions have character classes as well, but a
different notation than Perl, i.e. \s is [[:blank:]], \w is
[[:alnum:]], etc. See

http://www.ittvis.com/codebank/search.asp?FID=311

for a more detailed account.

Mike
--
www.michaelgalloy.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: how get data from iSurface
Next Topic: Re: FSC_color and loadct clashing

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

Current Time: Thu Oct 09 22:07:52 PDT 2025

Total time taken to generate the page: 0.08208 seconds