Hey Chaoz,

<code>  
#!/usr/bin/perl

use strict;
open(FILE,'<file.txt') or die "Can't open file.txt: $!\n";
my @text=(<FILE>);
close(FILE);

for(@text) {
  /(d+)$/; # Match only the numbers at the end of the string
           # and store them in '$1' to be printed out on the
           # next line followed by a new line character
  print $1,"\n";
}

exit;
</code>

shawn
----- Original Message ----- 
From: "ChaoZ InferNo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 17, 2002 4:01 AM
Subject: regular expression


> hi all,
> 
> i am working to split the data in my array as follows but ended up clueless, 
> hoope some of u can help.
> 
> @text # contains values of a phone directory
> $text[0] contains john=012345678
> 
> $phone1 = ?
> 
> let say i wanted to grab just the values'012345678'.
> how should i go on truncating the values?
> 
> kindly advice pls.
> 
> thanks!
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
> 
> 
> -- 
> 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