newstring = ListRest(string,"|");
newstring = ListDeleteAt(newstring,ListLen(newstring,"|"),"|");
OR
newstring = REReplace(string, "^[^|]*\|(.*)\|[^|]*$", "\1");
> -----Original Message-----
> From: Jeff Waris [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 20 april 2004 15:12
> To: CF-Talk
> Subject: RE: Odd RegEx question, a bit further....
>
> Say we switch this up a bit. I figured if i was vague I could
> learn a little more about regex, but, its not quite working
> out that way... LOL.
>
> I have two possible result strings that MAY come in...
>
> prestring|result1|result2|poststring
>
> or just
>
> prestring|result1|poststring
>
> I just need to eliminate the everything up to the first | and
> everything after the last |. I will always have at least two
> | in the returned string to me, Sometimes three.
>
> I tried to morph what you guys said to fit my needs but it
> just didn't happen.
>
> Any other help would be appreciated. This needs to work on
> both CFMX and CF5.0.
>
> Jeff
>
>
> -----Original Message-----
> From: Pascal Peters [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 20, 2004 3:16 AM
> To: CF-Talk
> Subject: RE: Odd RegEx question.
>
>
> In cf5:
> newstring = rereplace(string, "[^(]*(\(.*\)).*", "\1");
>
> Note that this will return the entire string if there is no
> parentheses.
> You could do it in two steps to avoid that
>
> newstring = "";
> stTmp = REFind("\(.*\)",string,1,true);
> if(stTmp.pos[1]) newstring = Mid(string,stTmp.pos[1],stTmp.len[1]);
>
> > -----Original Message-----
> > From: Ben Doom [mailto:[EMAIL PROTECTED]
> > Sent: maandag 19 april 2004 22:41
> > To: CF-Talk
> > Subject: Re: Odd RegEx question.
> >
> > If CFMX:
> >
> > newstring = rereplace(string, ".*?(\(.*\)).*", "\1");
> >
> > If CF5, I'll ... uh ... thing of something else. :-)
> >
> > Caveats: untested, off the top of my head, YMMV
> >
> > --Ben Doom
> >
>
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

