For the PBK1234567890 number, you need to create a regular template to add to the beginning of 7, if the number does not begin with PBK and consists of 10 digits (ie 1234567890), then add 7 to the beginning (it should turn out 71234567890). But do not add 7 if the number starts with PBK. I compiled a template, but I cannot complete the logic (the bundle And for two groups does not work and perhaps the expression DOES NOT start correctly): s / ^ (! PBX) (\ d {10,}) / 7 $ 2 / g
s/^(\d{10,})/7$1/and by the way, why at the end ofg? - Mikegis global, which would make several replacements in the string. But you have a replacement tied to the beginning of the line. there can be only one, so it is not needed. I just saw him suspecting that maybe everything is more complicated ... - Mike