I am looking for a regex to get just about the words in CAPS
for eg : I have an array that is storing the file paths and these could be in any following pattern
images/p/n/ct/XYZ-WW_V1.jpg
images/p/c/ABC-TY_V2.jpg
So basically I want just “XYZ-WW” and “ABC-TY” .
Any suggestions what regex to use in my split code . I am using the following
foreach (@filefound){
my @result = split('_',$_);
push @split1, $result[0];
}
This is just splitting at the _ and I am accessing the [0] the value but now I want to get just the part that is in CAPS .
Any Suggestions please !!
I’m thinking this should work: