I need to add a number to a backreference while doing a replace operation.
e.g. I am rewriting a URL
www.site.com/doc.asp?doc=321&language=1
to
www.site.com/headline/100321.article
I'm doing a simple replace, but I need to add 100,000 to the doc ID. What I have below works so far without adding anything.
s/.*doc=(\d+).*/www.site.com\/headline\/$1.article/g;
How can I add 100,000 to $1
?
Note, you can't just add 100
before the number because the doc ID might be > 999.