in reply to Parsing of a string
Also assuming that the hex number is terminated by a non-word ([^a-zA-Z0-9_]) character.my $data = join '', <DATA>; if($data =~ /(0x\w+)/) { print "$1\n"; } __DATA__ 1:05:02.599,xx:MTV = 0x2f7c:COOL_CALL, an option = 11
|
|---|