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

Home » Public Forums » archive » Re: stregex question
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: stregex question [message #67470 is a reply to message #67221] Tue, 21 July 2009 10:58 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Mike,



> IDL> pos = stregex(s, '([^e]e[^e])|(^e[^e])|(^e$)|([^e]e$)')
> IDL> pos += strmid(s, pos, 1) ne 'e'

Thanks for the quick reply. For my own reference when I go back to
google this answer, the above code is testing 4 possibilities

[^e]e[^e] - "e" surrounded by non-"e"
(^e[^e]) - "e" at beginning of string followed by non-"e"
(^e$) - Single character string with value "e"
([^e]e$) - - "e" at the end of the string preceded by a non-"e"

In the first and last case (testing a preceding character) one needs
to add 1 to the position found. --Wayne
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL KML
Next Topic: IDL question about IMSL_NLINLSQ

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

Current Time: Fri Oct 10 08:07:00 PDT 2025

Total time taken to generate the page: 0.00181 seconds