, , .
, "" , .
, Match Groups - , , , .
:
<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>
:
http://www.hybridchill.com/projects/jre-utils.html
, java.util.regex, CF org.apache.oro.text.regex engine, , ().
, , , .
, , , , , : , - :
Jrex.replace( MyString , MyRegex , "\F:DateAdd('h',1,\1)" , 'all' )
, - .