Thanks Pascal works great. Just one question is there any way I can make a
choice like
say my string is
<cfset s="Hotel Reservations Online. Discount Hotel Reservations in every
city -  Orlando, Las Vegas, New York, London, Miami and more.">

If I want to get fisrt 2 words then it will return  Hotel Reservation and if
want ot get just the second word the it will return just Reservation. I know
I can do this by calling the function again one more time.

Ketan Patel

  -----Original Message-----
  From: Pascal Peters [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, January 21, 2004 2:56 AM
  To: CF-RegEx
  Subject: RE: Regex function help needed.

  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