I doubt this fits what you have described, but it may be of interest:

#!/usr/local/bin/perl use strict; use warnings; my @words = split /\s+/, <<WORDS; a alien all allows always an and are as best but can certainly command confession context counting dictionary does each even fact find for fo +und from have here hope i if immediate importance intuitively is just letter le +tters like list low make mimic monks my need never obvious occur of one only opti +on pattern per perl physical plainer pure question quite regex regexp search tabl +et that the these thing think this those to tokens up use using which with wor +ds you WORDS my %normLu; push @{$normLu{normWord ($_)}}, $_ for @words; my $match = buildRegex ('adeilln'); my @matches = map {@{$normLu{$_}}} grep {/^$match$/} keys %normLu; print "@matches\n"; sub normWord { return join '', sort split '', $_[0]; } sub buildRegex { my ($word) = @_; my %freq; ++$freq{$_} for split '', $word; return join '', map {"$_\{0,$freq{$_}\}"} sort keys %freq; }

Prints:

alien all and an a i
True laziness is hard work

In reply to Re: Regex question once-only use of chars in a charset by GrandFather
in thread Regex question once-only use of chars in a charset by gje21c

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.