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
Re: Regular Expressions [message #24213 is a reply to message #24195] Fri, 16 March 2001 09:20 Go to previous messageGo to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Wayne Landsman wrote:

> P.S. The real-life problem I am working on deals not with 'l' but with
> apostrophes. I am trying to speed up the processing of FITS header
> values, where is a string is delineated by non-repeating apostrophes, and a
> possessive is indicated by a double apostrophe.
>
> VALUE = 'This is Wayne''s FITS value' / Example string field

how about:

IDL> value= "VALUE = 'This is Wayne''s FITS value' / A FITS COMMENT"
IDL> print,(stregex(value,/SUBEXPR,/EXTRACT,"= *'(.*)'([^']|$)"))[1]

You will always have something before the initial "'" in the full header
record.

You can then change double quotes to single quotes in the usual way with
a strpos loop.

JD
[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 17:27:50 PDT 2025

Total time taken to generate the page: 0.00479 seconds