Hello All,
I am trying to write a Function to get the volume name Prefix pattern from the Storage controller name.
the Storage controller name could be :
cgtestx123.iceage.com or
mfdevx234.sid.iceage.com or
The volume Prefix that we are expecting is :
if the Storage is cgtestx123.abc.com volume name prefix should be => test123v[3 digit number]
if the Storage is mfdevx234.abc.com volume name prefix should be => dev234v[3 digit number]
So, if i would have to explain it, i can say that i need to take from 3rd character till character "x" and the numeric's before the domain name ".sid..... or .iceage...."
The function i am trying to write is not helping:
def getVolumeprefix (storagecontroller)
{
java.util.regex.Pattern RESOLVE_PATTERN = java.util.regex.Pattern.compile("(^.*?)(\\d+)(.\.*?)");
java.util.regex.Matcher matcher = RESOLVE_PATTERN.matcher(storagecontroller);
String number = matcher.group(2);
String site = storagecontroller.substring(2,5);
String volname = site + number + "v";
return volname;
}
can someone please help me in fixing this pattern function.
,Sheel