@Neculai-I.-Fantanaru ,
It’s not your originally-stated request (ie, it does not put those exact numbers in reverse order), and it won’t work if your number range changes.
But if it works for what you really want (rather than what you asked for), that’s great for you.
Someone said you can’t get increment with regex, well, you can
Not generically, you can’t.
If you have a limited set of numbers, it’s really easy to do, as you found, by crafting regex cumbersome regex, but those get less viable the wider range of numbers you want – just try going from 101 - 199, for example; or, worse, from 101-9999 – . Guy has shown much wider ranges than your effort, but it will never be generic, as someone will always need “one more digit” than your regex provided.
(update: I also don’t see how that’s “increment”, in any meaningful interpretation of the word: it doesn’t just “add X” to the original number; it just copies the last digit to before the first)
Also: Per my reading of your original question, where I assumed “in reverse order” meant 162 ↔ 151; 161 ↔ 152; 160 ↔ 153 (like you said), rather than some weird rearrangement of the digits withing a given number (151→1151, 152→2152, …) (like I now see that I think your python did: I hadn’t bothered reading your python before, because I assumed it did what you said you wanted), I would now propose a different solution to what I thought you were asking for, given that you seem to only care about 151-162, and no other numbers: FIND = Page_(?:(151)|(152)|(153)|(154)|(155)|(156)|(157)|(158)|(159)|(160)|(161)|(162)) REPLACE = Page_(?{1}162)(?{2}161)(?{3}160)(?{4}159)(?{5}158)(?{6}157)(?{7}156)(?{8}155)(?{9}154)(?{10}153)(?{11}152)(?{12}151) – but since that’s not generic, it’s 99.9999% of the time not what someone would would want, if they phrased the question the way you did in your title and your mapping. I now don’t think this is actually what you wanted, based on your python and your pseudo-increment; but if it is what you originally wanted, feel free to use it.