Skip to main content


I want to process lines that start on "ROW<number> blabla" and increment the number by 2. Eg: "ROW13 There's a lazy brown fox" -> "ROW15 There's a lazy brown fox".

My first attempt:

perl -pe 's/(\d+)/$1+2/e'

works but replaces numbers EVERYWHERE not just after ROW, so I tried:

perl -pe 's/ROW(\d+)/ROW$1+2/e'

but this doesn't work at all.

submitted by /u/redzorino
[link] [comments]