in reply to Regexp help

If you wanted to shorten up the regex, you could do something like this:

my $str = "R4:abcxyz45:LNX"; my ($servername) = ($str =~ /:(.+):/);

However, I should point out that this has a greater potential to create problems than the regexes offered by kennethk. In other words, the above has shorter keystrokes, but kennethk's solutions are safer.