Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

RE: RE: Re: Reg. Expression problem

by jlistf (Monk)
on Aug 02, 2000 at 20:44 UTC ( [id://25771]=note: print w/replies, xml ) Need Help??


in reply to RE: Re: Reg. Expression problem
in thread Reg. Expression problem

allright... how about:
while (<FILE>) { print "$1\n" if $_ =~ m/(\d+)$/ }
this will print the last number on each line, if it is the last character on the line. for any more help, you're going to have to let us know how you decide that you want to print something.

Replies are listed 'Best First'.
RE: RE: RE: Re: Reg. Expression problem
by Anonymous Monk on Aug 02, 2000 at 20:51 UTC
    Thankx jeff, If I want, suppose, 32 different numbers. 1, 34 , 45, 62...and other random ones
    Do I have to write all the numbers or is there any other easier way?.......

      If you already know the numbers that you want and you only want to print the numbers, why are you processing the file at all?

      I guess I'm trying to say that I have absolutely no idea what you are trying to achieve here. Can you be more specific?

      Nuance

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://25771]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 01:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found