Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: minimal superstrings/maximal substrings

by AnomalousMonk (Bishop)
on Aug 20, 2019 at 01:01 UTC ( #11104712=note: print w/replies, xml ) Need Help??

in reply to minimal superstrings/maximal substrings

Something like this?

c:\@Work\Perl\monks>perl -wMstrict -le "my @lexi_short = qw(numeric sociobio social); ;; my ($rx_lexi_short) = map qr{ (?i) \A (?: $_) .+ }xms, join ' | ', map quotemeta, reverse sort @lexi_short ; ;; printf '%s ', $_ for grep /$rx_lexi_short/, qw(socialist sociobiologist numerical NUMERICIST), qw(social antisocial numeric bio cia) ; " socialist sociobiologist numerical NUMERICIST
See haukex's Building Regex Alternations Dynamically.

Update: For future reference, please see also Short, Self-Contained, Correct Example and How to ask better questions using Test::More and sample data (and maybe I know what I mean. Why don't you?).

Give a man a fish:  <%-{-{-{-<

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2019-09-17 00:39 GMT
Find Nodes?
    Voting Booth?
    The room is dark, and your next move is ...

    Results (199 votes). Check out past polls.