I assume you want

$str = $1 if $str =~ /(\d\d\s*$)/;

always make sure to test for a match before using $1, $2, etc.  If you
don't you may get a runtime warning.

On Tue, 2002-01-29 at 16:12, Dhiraj P Nilange wrote:
> 
> Hello
> actually its very simple to answer for who knows basic perl.
> 
> Suppose I have a string in $str
> I wanto extract some part of it based on regex and store it in the same string. how 
>do i do that?
> 
> say...
> 
> $str=~ $str /\d\d\s*$/;
> 
> but this doesnt work. seems some syntax problem..
> 
> help
> -dhiraj 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Today is Prickle-Prickle the 29th day of Chaos in the YOLD 3168
Fnord.

Missle Address: 33:48:3.521N  84:23:34.786W


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to