Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: reading from a text file

by samy_kumar (Scribe)
on Jun 07, 2005 at 12:13 UTC ( #464256=note: print w/replies, xml ) Need Help??


in reply to Re: reading from a text file
in thread reading from a text file

if ($_ =~ /.*(\d\d).*(\d\w+)/){
I think you might have forgot that \w indeed accepts digits.

-madasamy-

Replies are listed 'Best First'.
Re^3: reading from a text file
by tchatzi (Acolyte) on Jun 07, 2005 at 14:05 UTC
    No i didn't forget.
    But its either a '\d' inside the '()' like this (\d\w+)
    or a '\s' outside like this \s(\w+)
    Do you see any big difference?
    Cause if you don't use either of them and write it like this
    ($_ =~ /.*(\d\d).*(\w+)/)
    Then the only thing that $2 will have inside, will be a single 'T'.
    So i suggest you study a bit of regex more, before coming to conclusions

    ``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI
Re^3: reading from a text file
by tchatzi (Acolyte) on Jun 07, 2005 at 14:18 UTC
    The only thing you can take out is the first ' .* '
    Which i put there for educational reasons, cause the guy doesn't know too much of regex, so there is no need to give him a hard time, yet.

    ``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-06-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (83 votes). Check out past polls.

    Notices?