Page 1 of 1

Backreferences for Regular Expressions requested

Posted: 19 Aug 2008 17:17
by WordBaron
I've done a few searches in the forum and I don't see any references to backreferences. As a big fan of regular expressions, I hoped that the regex replace in XYplorer would support backreferences. For instance if I do a search and replace on (\d{2})(\d{2})(\d{2})([AP]M) > \1-\2-\3 \4 I would expect it to replace 041435PM with 04-14-35 PM. Basic backreference support makes the regex renaming so much more powerful. If this is supported in the current version, I'm sorry for the request, I just don't see anything in the documentation about it.

WordBaron

Re: Backreferences for Regular Expressions requested

Posted: 19 Aug 2008 17:29
by TheQwerty
XY's regex engine uses a dollar sign notation for backreferences.
So instead of:

Code: Select all

(\d{2})(\d{2})(\d{2})([AP]M) > \1-\2-\3 \4
You'd want:

Code: Select all

(\d{2})(\d{2})(\d{2})([AP]M) > $1-$2-$3 $4