in reply to Replacing 3 and 4 digit numbers.
not sure to have understood your question: anyway you have to very similar statements that probably can be reduced to one
qr{ \b \d{3,4} \b }xms
See perlrequick for the quantifiers introduction.
In addiction, if i understand the issue, you can tell the regex to match only if, for example, the numbers are not between href= and what you can consider the rigth end of your URLs.
More strict is your regex more accurate will be results: you have to know (and predict!) where these digits can be candidate for the substitution.
Only you can tell what your data is: you need to find the right regex for your all possible cases. Know your Data is an important rule. If you can post an exmple of a normal line and also one line with the problem, probably you 'l get better answers.
L*
|
|---|