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

Home » Public Forums » archive » Re: again strsplit
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: again strsplit [message #37734 is a reply to message #37730] Thu, 22 January 2004 06:59 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
savoieNoSpam@nsidc.org wrote:
> Reimar Bauer <R.Bauer@fz-juelich.de> writes:
>
>
>> Hi all
>>
>> I have learned the /regex keyword but who could explain this:
>>
>> a='ABC$DEF'
>> print,strsplit(a,'$',/extr)
>>
>> ABC DEF
>>
>> and
>>
>> a='ABC$DEF'
>> print,strsplit(a,'$',/extr,/regex)
>>
>> ABC$DEF
>>
>>
>> Why is this differnt?
>
>
> Because '$' is the regular expression for end of line. If you want to have
> the actual dollar sign, you need to escape it with a back slash first.
>
> IDL> print,strsplit(a,'\$',/extr,/regex)
> ABC DEF
>
> Helps?
>
> Matt
>


Dear all

Thanks,


Is there a function available which returns the key codes of regular
expression signs.

This is now a bit complicated. I have to use /regex because the
separation could be done by more as one sign. But if it is a $ or
something else of a regex code I have to add a \ sign in front.

If a variable is used for the separator have I always to test on this?

The old str_sep routine without regex was much clearer.

regards
Reimar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: "Color vectors" & shading
Next Topic: Re: write unix textfile with windows idl

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

Current Time: Sat Oct 11 08:18:36 PDT 2025

Total time taken to generate the page: 2.00842 seconds