Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Pattern Finding

by demerphq (Chancellor)
on Sep 17, 2001 at 03:19 UTC ( #112771=note: print w/ replies, xml ) Need Help??


in reply to Re: Pattern Finding
in thread Pattern Finding

Well I came up with a solution but for bizarre reasons decided to obfu it, so I posted it as Pattern Matching Obfu, you will have to change the string $S as appropriate to your requireements. Your clarification of the constraints on the problem lead to some interesting angles, some that I suspect are unintended. Most especially that irrelevent of the short pattern solution there are likely to be very many long patterns, each of which _ONLY_ match once.

My algorthm, in a rather humourous fashion found the following solutions, amongst many others, that meet your critera in a very short amount of time (the | is the seperator between sub patterns):

bookhelloworldh|ellohellohihell|ohiworldhihello|worldhihelloboo|kpenbo +okpenworld bookhelloworldh|ellohellohihell|ohiworldhihello|worldhihellobook|penbo +okpenworld bookhelloworldh|ellohellohihell|ohiworldhihello|worldhihellobookp|enbo +okpenworld bookhelloworldh|ellohellohihell|ohiworldhihell|oworldhihellobookp|enbo +okpenworld bookhelloworldhe|llohellohihell|ohiworldhihello|worldhihellobookp|enbo +okpenworld bookhelloworldhel|lohellohihell|ohiworldhihello|worldhihellobookp|enbo +okpenworld bookhelloworldhel|lohellohihello|hiworldhihello|worldhihellobookp|enbo +okpenworld bookhelloworldhel|lohellohihello|hiworldhihello|worldhihellobook|penbo +okpenworld bookhelloworldhel|lohellohihelloh|iworldhihello|worldhihellobook|penbo +okpenworld bookhelloworldhell|ohellohihelloh|iworldhihello|worldhihellobook|penbo +okpenworld
Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)


Comment on Re: Re: Pattern Finding
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-11-27 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (187 votes), past polls