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

Home » Public Forums » archive » regular expressions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
regular expressions [message #15713] Fri, 04 June 1999 00:00 Go to previous message
Michael Werger is currently offline  Michael Werger
Messages: 34
Registered: May 1997
Member
Dear IDL'ers

for a complex batch processing in IDL I need to do some regular
expression handling. Of course I can do this like:

function regexp_match,argument,pattern
defsysv,!true, 1 eq 1 ; defined here only for completeness
defsysv,!false, 1 eq 0 ; see above

command='perl -e ''print ("'+argument+'" =~ m/'+pattern+'/)'''
spawn,command,result
if (result[0] eq 1) then result = !true else result = !false
return,result
end

and then in some code:

if regexp_match(string,'\s*\d+') then print,'(spaces and) digits found!'

but this is rather slow, requires perl to be setup properly and
so on. Did anyone already wrote some routines like
regexp_replace and regexp_match (I think these names are speaking
for themselves? - like the tcl routines regsub and regexp?

Suggestions to improve the above routine are also welcome.


--
Michael Werger ------------o
ESA ESTEC & Praesepe B.V. |
Astrophysics Division mwerger@astro.estec.esa.nl|
| Postbus 299 http://astro.estec.esa.nl |
| 2200 AG Noordwijk +31 71 565 3783 (Voice)
o------------------- The Netherlands +31 71 565 4690 (FAX)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Time convertion
Next Topic: Re: curvefit Q

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

Current Time: Wed Oct 08 15:07:14 PDT 2025

Total time taken to generate the page: 0.00478 seconds