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

Home » Public Forums » archive » 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 #67469 is a reply to message #67222] Tue, 21 July 2009 12:06 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 21, 12:58 pm, wlandsman <wlands...@gmail.com> wrote:
> 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

Ouch! my head hurts...
[Message index]
 
Read Message
Read Message
Previous Topic: Re: spherical harmonic representation
Next Topic: IDL KML

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

Current Time: Sat Oct 11 03:11:37 PDT 2025

Total time taken to generate the page: 0.95941 seconds