The stupid question is the question not asked | |
PerlMonks |
Re: Puzzle Regex: Letter Frequency Arithmetic Sequenceby LanX (Saint) |
on Oct 17, 2017 at 15:42 UTC ( [id://1201509]=note: print w/replies, xml ) | Need Help?? |
The link you gave shows an example but doesn't phrase criteria, which is unfortunate for a puzzle. Please see How do I post a question effectively? Supposing the frequency of letters has to be an ascending sequence. .. I'm not aware of a possibility to sum the count of matches in pure ² m// regexes so probably it's possible in tr// but those can't backtrack. Probably if you code 1..n matches for a fixed n into your regex and combine n look-aheads you can built an and condition. * This wouldn't work for arbitrary big n though.
Cheers Rolf
*) that is find one letter exactly once and find one letter exactly twice and so on. already the first term is too tricky for me... ²) no Perl embedded
updateFirst step: What is a regex to find one letter exactly once?
updateWaiting for tybalt89 ... tick tock tick tock ... ;)
In Section
Seekers of Perl Wisdom
|
|