-----Original Message-----
>From: "Sayed, Irfan (Irfan)" <[EMAIL PROTECTED]>
>Sent: Dec 20, 2007 4:53 PM
>To: "beginners @ perl. org" <beginners@perl.org>
>Subject: reg. ex.
>
>Hi All,
> 
>I have one string like this "test@/vobs/pvob_aic";
> 
>Now I want only "test" from this string, so I wrote reg. ex. like this
> 
>$test="test@/vobs/pvob_aic";
>$ts = ($test =~ m{(.+)@$});

'$' means end of a line, you shouldn't specify a $ here.


>
>But I am getting output as 1 not a string "test" 
> 
>can some body please give me exact reg.ex. to achieve this
> 

$ perl -Mstrict -le '$_="test@/vobs/pvob_aic"; print $1 if /(.+)\@/'
test

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to