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 
Switch to threaded view of this topic Create a new topic Submit Reply
Regular Expressions [message #24193] Thu, 15 March 2001 14:29
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
The following is probably a simple question for anyone familiar with
regular expressions, but I am still trying to learn the STREGEX
function.

Suppose I want to find the first occurence in a string of an 'l' ithat
is not part of a double 'l'. For
example, in the string

IDL> st = 'The rolling hills and lake'

I want to return the character position of the 'l' in lake (=21).

The following expression almost works -- it will search for any 'l'
which is both preceded and followed by anything that is not "l"

IDL> print,stregex(st, '[^l]l[^l]' )

but it won't work for the string 'The rolling hills and pool' because
the final 'l' has no characters following it. Any suggestions?

thanks, --Wayne Landsman
landsman@mpb.gsfc.nasa.gov
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: cw_fslider
Next Topic: Re: frustrated by hdf_sd_adddata

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

Current Time: Wed Oct 08 10:57:07 PDT 2025

Total time taken to generate the page: 0.00459 seconds