Dear Monks,
I want to achieve following. I have a string called bge1 and I want to convert it to bge:1. to make it more specific, search the substring in the end of string and if it is number replace it with :number. I am trying following
my $Interface = bge1; $Interface =~ s/[0-9]\$/:\$&/;
but still result is bge1
what is wrong with it?
In reply to find a substring using regex and then replace it by swissknife
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |