Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: minimal superstrings/maximal substrings

by AnomalousMonk (Archbishop)
on Aug 20, 2019 at 01:01 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11104712]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-24 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found