Just put the part you want to extract in parentheses and then set $str equal
to $1...for example:

$str =~ /(\d\d\s*)$/;
$str = $1;
----- Original Message -----
From: "Dhiraj P Nilange" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 29, 2002 4:12 PM
Subject: a very simple question


>
> 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]
>


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

Reply via email to