Regular Expression (searching from the end)

2005-01-12 Thread Andrew Dixon
Hi Everyone. I need to find the last occurance of a character in a string. Is there a way I can use a regular expression to search the string from the end backwards for the character? Or is there another way I can do it using a CF function. At the moment I have a conditional loop that uses the

Re: Regular Expression (searching from the end)

2005-01-12 Thread Adam Haskell
reverse the string, find the character, length of the string minus the pos of the character. Adam On Wed, 12 Jan 2005 11:39:24 +, Andrew Dixon [EMAIL PROTECTED] wrote: Hi Everyone. I need to find the last occurance of a character in a string. Is there a way I can use a regular

Re: Regular Expression (searching from the end)

2005-01-12 Thread Adam Haskell
Alernatively you can use refind and return the array thing I beleive it returns the POS and Len of all the times it found then you could just look at the last element in the array, TIMTOWTDI. Adam H On Wed, 12 Jan 2005 11:39:24 +, Andrew Dixon [EMAIL PROTECTED] wrote: Hi Everyone. I

Re: Regular Expression (searching from the end)

2005-01-12 Thread Andrew Dixon
Nope. The array thing still only gives the first occurance. Andrew. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message:

RE: Regular Expression (searching from the end)

2005-01-12 Thread Pascal Peters
previous post. Reverse the string and look for the first occurrence. -Original Message- From: Adam Haskell [mailto:[EMAIL PROTECTED] Sent: 12 January 2005 13:16 To: CF-Talk Subject: Re: Regular Expression (searching from the end) Alernatively you can use refind and return the array thing

Re: Regular Expression (searching from the end)

2005-01-12 Thread Andrew Dixon
Thank you very much Pascal. Worked like a dream. Andrew. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message:

Re: Regular Expression (searching from the end)

2005-01-12 Thread Jochem van Dieten
Andrew Dixon wrote: I need to find the last occurance of a character in a string. REFindNoCase(.*character, string, TRUE) will give you a position and a length. Position will always be 1, length will tell you the last occurance. Jochem