\w won't match ':', it will match only [0-9a-zA-Z_].
You try this
$_ = "package MyClass::Subclass::one; package Myclass::two;"; /^(\w+) ([\w:]+)\;/; print $2;
Also take a look at perlre.
Prasad
In reply to Re: Regular Expression
by prasadbabu
in thread Regular Expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |