Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2020-09-26 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (141 votes). Check out past polls.

    Notices?