CF5.  In the following I keep getting a bad backreference error.  I 
thought the nested expressions in parens should give me \1 = entire 
matching string, then \2 = first submatch, \3 = 2nd submatch, etc.

I'm taking a string containing concatenated three-character weekday 
abbreviations and expanding them.  Example:

SatSun => Sat,Sun

re = 
'((sun)(mon)|(mon)(tue)|(tue)(wed)|(wed)(thu)|(thu)(fri)|(fri)(sat)|(sat)(sun))';
s = REReplaceNoCase(s, re, '\2,\3', 'all');    // adjacent weekdays


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:226459
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

Reply via email to