Hi DaveyD and All,
Ah, Yes ! I can apply the Dail’s \K syntax to my previous regex. So, finally, here are my two solutions :
Find what : (?<!\|)\t(.+)(\R[|\t-]+) which works with, either, the Replace All or the Replace button
OR
Find what : [^|]\t\K(.+)(\R[|\t-]+), which ONLY works with the Replace All button
For these two search regexes, the replacement regex is :
Replace with : $2$1$2
I don’t think that we can shorten them, anymore !
Notes :
When your search regex contains a \K form, the step by step replacement never works !! That’s the normal behaviour !
There are two cases, where the \K feature is mandatory and can NOT be replaced with lookbehinds :
When the regex, inside the lookbehind, could match non-fixed length strings, as, for instance, the regex (?<=\d+)abc
When the regex, inside the lookbehind contains alternatives, of different length, as, for instance, the regex (?<=(12|345|6789))abc
So, in order to get valid regular expressions, you must change them, respectively, into the two, below, which include, both, the \K syntax :
\d+\Kabc
(12|345|6789)\Kabc
On the contrary, for instance, the two regexes (?<=\d{3})abc and ((?<=(00|99))abc are quite valid ones. Indeed, inside the lookbehind, the former refers to a three-digits number, only and, in the later, each alternative refers to a same two-digits number :-)
You may test these 4 regexes against this short example text, below :
00abc
12abc
345abc
6789abc
99abc
Cheers,
guy038