[Chicago-talk] regural expression question?

tiger peng tigerpeng2001 at yahoo.com
Thu Mar 30 06:43:00 PST 2006


type command and read
perldoc perlrequick

--- Richard Reina <richard at rushlogistics.com> wrote:

> I have a little script that finds the line which
> contains a six digit number begining with 1 or
> greater.  I know that $_ represents the line, 
> however, I am having trouble figuring out how to
> save that number once it's found (without everything
> else in the line).
>  
>  #!/usr/bin/perl -w
>  
>  @ARGV = "/home/richard/test/out.txt";
>  while (<>) {
>      if ( /\b[123456789][0-9][0-9][0-9][0-9][0-9]\b/
> ) {
>          print "Found\n" . $_ . "\n";
>      }
>  }
>  
>  Any help would be greatly appreciated.
>  
>  Thanks,
>  
>  Richard
>  
> 
> A people that values its privileges above its
> principles soon loses both.
>  -Dwight D. Eisenhower.>
_______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk



More information about the Chicago-talk mailing list