in reply to checking particular part of string

G'day sumandas,

Please do not delete your post and just replace it with something different.

Three monks have voluntarily given their time to try to help you. Because you've changed your post, their responses are meaningless and you have completely wasted their time!

Please read "How do I change/delete my post?".

Given your new question, this does what you ask:

#!/usr/bin/env perl -l use strict; use warnings; my @strings = qw{MUXmh123 MUXho124 999999}; my @results = map { /(\D+)/ ? "\U$1-" : () } @strings; print for @results;

Output:

MUXMH- MUXHO-

-- Ken