V
vorticitywolfe
Hello,
I have a string like such "STAT 09834Z 12004KT VV001 BKN150 OVC220
A3025 T00281039"
I want to grab the VV001 BKN150 and OVC220 part in different variables
$1, $2, $3, etc..
I am parsing the string with this regex:
@return = m/((VV|BKN|OVC)\d{2,4})/g;
and print with
for(@return){print $_,"\n";}
Why does it return:
VV001
VV
BKN150
BKN
OVC250
OVC
?
in the regex I think it's somewhat explicit in keeping the first 2 or
3 characters together and then keeping the rest appended, but perhaps
I'm misinterpreting what it's doing. Any help would be appreciated.
Thank you!
Jonathan
I have a string like such "STAT 09834Z 12004KT VV001 BKN150 OVC220
A3025 T00281039"
I want to grab the VV001 BKN150 and OVC220 part in different variables
$1, $2, $3, etc..
I am parsing the string with this regex:
@return = m/((VV|BKN|OVC)\d{2,4})/g;
and print with
for(@return){print $_,"\n";}
Why does it return:
VV001
VV
BKN150
BKN
OVC250
OVC
?
in the regex I think it's somewhat explicit in keeping the first 2 or
3 characters together and then keeping the rest appended, but perhaps
I'm misinterpreting what it's doing. Any help would be appreciated.
Thank you!
Jonathan