View Single Post
Old 8th September 2019, 08:17   #796  |  Link
Nikse555
Registered User
 
Join Date: Feb 2004
Location: Mars
Posts: 428
It seems that ".*" also matches an empty string. So first "line1" will be replaced by "a" and then "" will also be replaced by "a" too giving "aa".
See https://stackoverflow.com/questions/...-empty-strings

So try ".+" instead to avoid empty strings... I don't know why it works like that
Nikse555 is offline   Reply With Quote