Hello, @rafał-kowalski,
My idea is to find, with a regex, a 00:00:00 time template, ONLY IF it’s followed, further on, by an other 00:00:00 time template and to store this second time template, in a group, for further use in replacement
To that purpose, we’ll use a positive look-ahead structure ( a condition which have to be true for an overall match, but which is never part of the final regex )
So, the regex S/R could be :
SEARCH (?s)\d\d:\d\d:\d\d(?=.+?(\d\d:\d\d:\d\d))
REPLACE $0 \1
Notes :
The first part, (?s), is a modifier, which means that the dot special character stands for any single character ( Standard or EOL ones )
Then the second part, \d\d:\d\d:\d\d, is the final text to find ( a 00:00::00 time template )
Now, the third part,(?=.........), is the positive look-ahead feature, which have to be true
Finally, the fourth part, .+?(\d\d:\d\d:\d\d), is the condition to respect :
.+? represents the shortest, non-null, range of any character, even split on several lines
(\d\d:\d\d:\d\d) is the nearest following 00:00:00 time template, which is stored as group 1, due to the surrounded parentheses
In replacement, we re-writes, first, the whole searched string ( $0 ), followed with a space character, and ended with the group 1 ( \1 ), which represents the second time template
REMARK :
It is important to point out that, when evaluating the condition .+?(\d\d:\d\d:\d\d, inside the look-ahead, the character position, used by the regex engine, is, finally, NOT moved and is still located, right after the last digit of the first time template ( the final regex to look for ), even if, somehow, it had to go ahead, till the end of the second 00:00:00 time template, in order to verify the condition )
So starting with your original text, below :
00:01:11 fdfdfdfdfdfdf 00:02:12 hjhgjjjjjjjjjjg 00:03:22 hgffggggggg 00:04:14 hjghhhghgggThis S/R would produce the text, below :
00:01:11 00:02:12 fdfdfdfdfdfdf 00:02:12 00:03:22 hjhgjjjjjjjjjjg 00:03:22 00:04:14 hgffggggggg 00:04:14 hjghhhghgggEt voilà !
Best Regards,
guy038