Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^2: regex, find words that occur more than once.

by GrandFather (Saint)
on Sep 15, 2020 at 00:15 UTC ( #11121777=note: print w/replies, xml ) Need Help??

in reply to Re: regex, find words that occur more than once.
in thread regex, find words that occur more than once.

Nice synthesis of the advice you got!

In production code dealing with many searches on large strings you might want to make the .* match in the look ahead assertion non-greedy (.*?) so a search to the end of the string isn't required. Also, adding sort to (keys %words) gets the words in consistent order making it easier to find particular results if there are a lot of words.

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2021-03-01 02:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found