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

Home » Public Forums » archive » Stregex question - extracting substring
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 - extracting substring [message #87008 is a reply to message #87007] Thu, 19 December 2013 12:53 Go to previous messageGo to previous message
John Correira is currently offline  John Correira
Messages: 25
Registered: August 2011
Junior Member
On 12/19/2013 03:44 PM, Paul Mallas wrote:
> I am trying to extract a substring after a colon. My string looks
> like:
>
> xxxxxx:yyyyyyyyy
>
> where x's can be spaces, upper and lower case letters
>
> then there's the colon
>
> and finally the y's, which can be pretty much anything and will often
> include colons (which is why strsplit("xxxxxx:yyyyyyyyy", ":") won't
> work for me here)
>
> I just want the yyyyyyyyyy part and have been trying to extract it
> with stregex, but no luck. But before I give up and will try a
> different approach, does anyone know how to construct a regular
> expression for IDL that would extract just the yyyy.. part with
> stregex?
>
> Thanks for your time.
>


Not a stregex solution, but I think something like

strjoin((strsplit(string,':',/extract))[1:*],':')

would do it.

John
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8.3 released
Next Topic: Problems with Retain on OS X Mavericks

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

Current Time: Wed Oct 08 18:22:14 PDT 2025

Total time taken to generate the page: 0.00428 seconds