Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Puzzle Regex: Letter Frequency Arithmetic Sequence

by QM (Parson)
on Oct 18, 2017 at 17:18 UTC ( #1201606=note: print w/replies, xml ) Need Help??


in reply to Re: Puzzle Regex: Letter Frequency Arithmetic Sequence
in thread Puzzle Regex: Letter Frequency Arithmetic Sequence

...sum the count of matches...

There's always the brute force method of generating every possible regex, assuming arithmetic sequence starting at 1. For a max frequency of 6, this covers 21 letter words. It makes me wonder what the breaking point is of my machine.

Note that in (3), only lengths that are triangular will do.

I'll have to find some time to chase this -- perhaps tomorrow.

-QM
--
Quantum Mechanics: The dreams stuff is made of

  • Comment on Re^2: Puzzle Regex: Letter Frequency Arithmetic Sequence

Replies are listed 'Best First'.
Re^3: Puzzle Regex: Letter Frequency Arithmetic Sequence
by LanX (Cardinal) on Oct 18, 2017 at 17:33 UTC
    I just remembered that Perl supports recursive regexes and relative back-references, so you might not be limited to a hard limit.

    Unfortunately I don't have the time to play with it.

    FWIW if using s///g was allowed you just needed a pattern which repeatedly deleted one character of each group, iff exactly one of them is unique.

    Your criterion was met, if the string is empty afterwards.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (1)
As of 2021-04-17 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?