Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Limiting number of regex matches

by Anonymous Monk
on Sep 25, 2012 at 22:19 UTC ( #995642=note: print w/replies, xml ) Need Help??

in reply to Re^2: Limiting number of regex matches
in thread Limiting number of regex matches

That doesn't limit the number of matches, it still counts/matches every single dog in the string

Replies are listed 'Best First'.
Re^4: Limiting number of regex matches
by 2teez (Vicar) on Sep 25, 2012 at 23:42 UTC

    Yes, why use a regex to match for an obvious substring in this case, when a string could be splited into an array, a slice of that which got the required output printed?
    Please, don't forget that the OP also asked among other things "..Is there no other way.."? Am simply showing, some other ways, in this case.

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me
      And I'm just pointing out the drawbacks

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995642]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-06-22 00:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (120 votes). Check out past polls.