I will just give a few examples as I think that is the best way to describe what I want, but basically I want to only keep the number but prepend text to the start depending on the first number (1 or 2: AAA, 3: BBB, 4 or 5: XYZ):
INITIAL STRINGS:
Blah 12345 Blah
Blah 22345 Blah
Blah 32345 Blah
Blah 42345 Blah
Blah 52345 Blah
RESULT:
AAA12345
AAA22345
BBB32345
XYZ42345
XYZ52345
Regex to search for:
([0=9])([0-9]{4})
Regex To replace with:
(SOME WAY OF DECIDING BETWEEN AAA|BBB|XYZ depending on \1!)\1\2
Is this possible?