$server_name =~ m{ \A # start of string .{1,3} # 1-3 characters \. # a literal period product1help\.com # literal 'product1help.com' }xms; #### $server_name =~ m{ \A # start of string ( # start capture 1 .{1,3} # 1-3 characters ) # end capture 1 \. # a literal period product1help\.com # literal 'product1help.com' }xms; my $prefix = $1;