Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: pattern match of first occurance

by rdfield (Priest)
on Jul 08, 2010 at 13:57 UTC ( [id://848695]=note: print w/replies, xml ) Need Help??


in reply to Re: pattern match of first occurance
in thread pattern match of first occurance

Or match only digits:
say $1 if $var =~m{<year>(\d+)</year>};

rdfield

Replies are listed 'Best First'.
Re^3: pattern match of first occurance
by deMize (Monk) on Jul 08, 2010 at 20:47 UTC
    Comment: Nope he said he's trying to get:
    2010<day>5</day>



    Demize
      Actually, no, he's not. The question was specifically why <year>.*</year> didn't match properly.

      rdfield

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2026-01-15 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.