I have a utility that allows you to achieve what you want.
Syntax isn't quite a same, and a tad irritating for 'simple' things, but ultimately it is more flexible.
Basically you write a function which accepts a Match
string and Groups
array and returns a String - inside the function you can do what you like and it'll get applied to each match.
Like so:
<cfset Jrex = createObject('component','jre-utils').init() />
<cfset MyString = "STARTDATE_2010-05-07 00:05:00.0_ENDDATE" />
<cfset MyRegex = "STARTDATE_([\s-.:0-9]*)_ENDDATE" />
<cfset MyString = Jrex.replace( MyString , MyRegex , addHour , 'all' )/>
<cffunction name="addHour" returntype="String" output="false">
<cfargument name="Match" type="String"/>
<cfargument name="Groups" type="Array" default="#ArrayNew(1)#"/>
<cfset var Result = DateAdd('h',1,Groups[1]) />
<cfreturn DateFormat( Result , 'yyyy-mm-dd' )
& ' ' & TimeFormat( Result , 'HH:mm:ss' )
/>
</cffunction>
Details and download here:
http://www.hybridchill.com/projects/jre-utils.html
One thing to bear in mind is that this uses the java.util.regex engine, which is different to CF's org.apache.oro.text.regex engine, and whilst this provides more features, a few things don't work (yet).
The next version is going to be a fairly major release, so any feedback you might have is very much welcome.
Specifically, one functionality I've been pondering is how to avoid the long-winded manual function callback method as above - perhaps enabling something like this:
Jrex.replace( MyString , MyRegex , "\F:DateAdd('h',1,\1)" , 'all' )
Would be good to hear if anyone has thoughts on that.