I'm trying to add a number 9 before a specific pattern in a file containing many EANs, like this example :
7,82897E+11 50 MATCHS DE HOCKEY 39,95 23,97 40 1 0 0
7,82924E+11 EINSTEIN 34,95 20,97 40 1 0 0
15 BEAUX LIVRES & SCIENCE 94,85 56,91 40 3 0 0
7,82101E+11 SCIENCE COMME VOUS NE L'AVEZ 34,95 20,97 40 1 0 0
I'm specifically searching for EANs (which are at the begining of data line) who starts with either 7,8 or 7,9 and I must add a 9 before those numbers.
So the pattern will look like 9,78xxx or 9,79xxx after the replacement.
I used this regexp to find those strings:
\t\t[7][,][8|9]
The two \t\t serves me to not replace the number AFTER the first one in the line.
I was thinking of this : \t\t[9],[7][8|9] but the last part [8|9] is not working, as I expected... I dont know how to just place the number found (8 or 9)...
Hope this is possible to do!
Thanks for any help! Greatly appreciated.
[89]does not need the alternation|.\1or\2. Or just use two regex: one for 7.8 and one for 7.9