Is it possible to find a string using regex pattern matching, manipulate it & return it?
For example:
mazda mazda6 mazda 6 mazda3 mazda2
I want 'mazda6','mazda3','mazda2' to be replaced by '6','3','2'. I can find them easily enough using regex (mazda\d), however I don't know how to replace them with a modified version of the matched pattern (i.e. the \d should remain).
Ideal output:
mazda 6 mazda 6 3 2