I have a line in the following format:
\main\stream\foo.h\3
it can have more or less โsectionsโ, but will always end with a slash followed by an integer. Other examples:
\main\stream2309\stream222\foo.c\45 \main\foo.c\9
I need to increase the number at the end of the line in Perl and leave the rest alone. I found an example on this site that does exactly what I want to do (see Increasing the number in a string with a regex ), only in Javascript. The solution is given:
.replace(/\d+$/,function(n) { return ++n })
I need to do the same in Perl.
perl
user396162
source share