Just replace \w by [[:alnum:]] and \W by [^[:alnum:]] for CF5. Should
work.

> -----Original Message-----
> From: Ketan Patel [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 20 januari 2004 18:05
> To: CF-RegEx
> Subject: RE: Regex function help needed.
>
> Hi Pascal,
> Thanks as always. Its  working in CFMX and not in CF5.0
>
>
> Ketan Patel
>
>   -----Original Message-----
>   From: Pascal Peters [mailto:[EMAIL PROTECTED]
>   Sent: Tuesday, January 20, 2004 11:41 AM
>   To: CF-RegEx
>   Subject: RE: Regex function help needed.
>
>
>   Then it all depends on what you define as a word.
>
>   This should work (NOT TESTED)
>
>   function GetWords(string,i){
>   var Regexp = "\w+";
>   var aTmp = "";
>   var out = "";
>   if(i GT 1) Regexp = "(\w+\W+){" & (i-1) & "}" & Regexp;
>   aTmp = ReFindNoCase(Regexp,string,1,true);
>   if(aTmp.pos[1]) out = Mid(string,aTmp.pos[1],aTmp.len[1]);
>   return out;
>   }
>
>   > -----Original Message-----
>   > From: Ketan Patel [mailto:[EMAIL PROTECTED]
>   > Sent: dinsdag 20 januari 2004 17:09
>   > To: CF-RegEx
>   > Subject: RE: Regex function help needed.
>   >
>   > Hi,
>   > I have CFMX and CF5.0 both. Unfortunately my development
>   > server is CF5.0 and my production server is CFMX. SO CFMX
>   > should be fine.
>   >
>   > Ketan Patel
>   >
>   >
>   >   -----Original Message-----
>   >   From: Pascal Peters [mailto:[EMAIL PROTECTED]
>   >   Sent: Tuesday, January 20, 2004 11:00 AM
>   >   To: CF-RegEx
>   >   Subject: RE: Regex function help needed.
>   >
>   >
>   >   What version of CF?
>   >
>   >   > -----Original Message-----
>   >   > From: Ketan Patel [mailto:[EMAIL PROTECTED]
>   >   > Sent: dinsdag 20 januari 2004 17:02
>   >   > To: CF-RegEx
>   >   > Subject: Regex function help needed.
>   >   >
>   >   > Hi all,
>   >   > I am looking for a regular _expression_ where I can get first
>   >   > 1,2,3 words of teh sentence. I want to pass a prameter saying
>   >   > give me 1, 2 or 3 words of teh sentence.
>   >   >
>   >   > Suppose My sentence is:
>   >   > Hotel Reservations Online. Discount Hotel Reservations in
>   >   > every city - Orlando, Las Vegas, New York, London,
> Miami and more.
>   >   >
>   >   > I want to get just 1 word then it should be Hotel. If 2 words
>   >   > then it should be Hotel Reservations.
>   >   >
>   >   >
>   >   > Ketan Patel
>   >   >
>   >   >
>   >   >
>   >
>   >
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to