﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1017	StringRegExpReplace - back-references --> add this as example in Helpfile	Zedna	Jpm	"According to this my post:
[http://www.autoitscript.com/forum/index.php?s=&showtopic=96512&view=findpost&p=693808]

There is no example in HelpFile for StringRegExpReplace - back-references.
So this may be added:


{{{
$text_in = _ 
'some text1 12/31/2009 01:02:03 some text2' & @CRLF & _
'some text3 02/28/2009 11:22:33 some text4'

; change date format from mm/dd/yyyy to dd.mm.yyyy
$text_out = StringRegExpReplace($text_in, '\x20(\d{2})/(\d{2})/(\d{4})\x20', ' $2.$1.$3 ')

MsgBox(0, ""RegExp Replace Test - back-references"", 'OLD:' & @CRLF & $text_in & @CRLF & @CRLF & 'NEW:' & @CRLF & $text_out )
}}}

Output:

{{{
OLD:
some text1 12/31/2009 01:02:03 some text2
some text3 02/28/2009 11:22:33 some text4

NEW:
some text1 31.12.2009 01:02:03 some text2
some text3 28.02.2009 11:22:33 some text4
}}}

; comments
#cs
\x20 is Chr(32) ie. space at begin and end of date
each part of date is closed in group ()
each group can be back referenced by $n starting from 1 so  '$2.$1.$3' means changed order of MM and DD and using dot instead of slash among date parts
#ce"	Feature Request	closed	3.3.1.1	Documentation		None	Completed		
