Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Pattern Finding

by demerphq (Chancellor)
on Sep 17, 2001 at 03:19 UTC ( [id://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)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found