|
I have following..
strg: unsigned short int lngt:7
and i want $1 = strg and $2 = unsigned short int
how do I do this. I´ve tried (strg):\s?(\w+)\s+ and so on but it dosent work.
|
|
|
the answer to your question is to do:
$1 = "strg";
$2 = "unsigned short int";
although i dont think thats what you ment to ask.
|
|
|
$str="strg: unsigned short int lngt:7";
$str =~ /(.*?):(.*) \w+:.*/;
print "\nfirst: $1\nsecond: $2\n";
output:--
first: strg
second: unsigned short int
|
|
|
|
|
|
|
// |