You're making up regular expression syntax. Perl doesn't know what you mean. Perl thinks you mean replace 'i', followed by any number of 'p' characters with 'ip-10.10.10.1-internal'.
I started trying to provide a regexp that would do what you want, but there are inconsistencies between your sample input, sample output, and the replacement portion of your sample code. If I guess, I'll probably guess wrong.
Perhaps you could follow up here with sample input and sample output that are consistent with one another, and a little clarification on the rules you wish to follow in transforming the input to the output so that we can assist without guessing.
Also, making up regex syntax is never going to be the path to regex success. You really do need to spend some time with perlintro and perlretut.
Dave
In reply to Re: Newbie regular expressions question
by davido
in thread Newbie regular expressions question
by bayareamonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |