Hi all, I just tried Marck's v2 adaptation of Carsten's Search and Replace QT from the QT library at:
http://www.silverstones.com/thebat/Library.html#search+and+replace It didn't seem to work as presented. I had to replace the '_' pairs in two places with a different character ('#') to get it to work: %IF:'%SETPATTREGEXP="\A(.*?);(.*?);(.*?)(\1)"%- %-%REGEXPBLINDMATCH="%_TEXT"%SUBPATT="4"'<>''%- :'%- %-%_TEXT=#%- %-%-%SETPATTREGEXP="\A(.*?);(.*?);(.*?)(\1)(.*?)\Z"%- %-%-%REGEXPBLINDMATCH="%_TEXT"%- %-%-%SUBPATT="1";%SUBPATT="2";%SUBPATT="3"%SUBPATT="2"%SUBPATT="5"#%- %-%QINCLUDE="replace"'%- :'%- %_TEXT="%SETPATTREGEXP=_\A(?:.*?;.*?;)(.*)\Z_%REGEXPMATCH=#%_TEXT#"'%- Taking further liberties, I changed it to the new, cleaner, syntax and rearranged things to make it clearer (to me, anyway): %SETPATTREGEXP("\A(.*?);(.*?);(.*?)(\1)")%- %REGEXPBLINDMATCH(%_TEXT)%- %IF:'%SUBPATT(4)'<>''%- :'%- %-%SETPATTREGEXP("\A(.*?);(.*?);(.*?)(\1)(.*?)\Z")%- %-%REGEXPBLINDMATCH(%_TEXT)%- %-%_TEXT="%SUBPATT(1);%SUBPATT(2);%SUBPATT(3)%SUBPATT(2)%SUBPATT(5)"%- %-%QINCLUDE(replace)'%- :'%- %-%SETPATTREGEXP("\A(?:.*?;.*?;)(.*)\Z")%- %-%_TEXT="%REGEXPMATCH(%_TEXT)"'%- It still appears to work. Now if I could just get my head around the regex's involved, I think I'd learn a lot! Nice QT BTW, very useful. -- George Using TB! 2.02.3 CE on Windows XP Pro 5.1, Build 2600, Service Pack 1. ________________________________________________________ http://www.silverstones.com/thebat/TBUDLInfo.html
