No, it returns pos and length of the subgroups, but you can use that with greedy matches to find the position:
position = 0; stTmp = REFind("^.*(a)",string,1,true); if(stTmp.pos[1]) position = stTmp.pos[2]; This gives the last position of "a". OR you can do what you suggested yourself in your 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 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 +0000, 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 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 > > Find() function to search until it returns 0 and then report the > > previous value as the last occurance. This works fine, but I feel > > there should be a better way. > > > > Thanks > > > > Andrew. > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190072 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54