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