Replacement expression truncated?
Posted: Sat Feb 26, 2005 2:25 am
I have a document containing several file names, like this:
rename "01 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - %" 01T_dtpOp.wav
rename "02 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - %" 02T_apriSlct.wav
rename "03 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - %" 03T_menuFix.w
What I'm trying to do is replace the % with the short name after the quotes, so the first one would be replaced with 01T_dtpOp.wav, the second with 02T_apriSlct.wav and so on. I've used this POSIX regular expression:
Find: [[:print:]]%" ([[:print:]])
Replace: \1" \1
[edit: There should be a space before the first '\1', but it doesn't show up on the board.]
The replacement works but the first \1 (replacing the percent sign) is truncated to one character! (Ex: rename "01 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - 0" 01T_dtpOp.wav) Why is this happening?
rename "01 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - %" 01T_dtpOp.wav
rename "02 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - %" 02T_apriSlct.wav
rename "03 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - %" 03T_menuFix.w
What I'm trying to do is replace the % with the short name after the quotes, so the first one would be replaced with 01T_dtpOp.wav, the second with 02T_apriSlct.wav and so on. I've used this POSIX regular expression:
Find: [[:print:]]%" ([[:print:]])
Replace: \1" \1
[edit: There should be a space before the first '\1', but it doesn't show up on the board.]
The replacement works but the first \1 (replacing the percent sign) is truncated to one character! (Ex: rename "01 - BooHooWoo - .hack,,GAME MUSIC Perfect Collection CD3 - 0" 01T_dtpOp.wav) Why is this happening?