Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
hi gr8 ppl
$_ = "package daa; package MyClass::two; package Myclass::SubClass::t +hree;"; /^(\w+) (\w+)\;/; print $2;
The above code works when given as package daa The same code will not work if the string is like this
$_ = "package MyClass::Subclass::one; package Myclass::two;" (please note the semi-colon after the module name)
I got struck here now.. Can anyone give a regex which will solve such kind of a string
Thank u
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Expression
by prasadbabu (Prior) on Dec 07, 2005 at 13:46 UTC | |
|
Re: Regular Expression
by holli (Abbot) on Dec 07, 2005 at 13:49 UTC | |
|
Re: Regular Expression
by PerlingTheUK (Hermit) on Dec 07, 2005 at 13:48 UTC | |
|
Re: Regular Expression
by merlyn (Sage) on Dec 07, 2005 at 19:43 UTC |