> But I believe your example is also for "all distinct letters", it isn't clear to me how you'd use it for BernieC's templates.
I find the wording "template" confusing and thought it's about constructing a complicated regex by templates, i.e. like it's done with HTML.
If "template" is supposed to mean character class $chars = "abc.." whose chars are never repeated anywhere in the string, a negated approach is probably the simplest
$str !~ / ([$chars]) .* \1 /x
edit
use v5.12;
use warnings;
my @words = qw"abc aab abb aba abcd abca";
my $chars = "ad";
for (@words) {
say "$_"
if $_ !~ / ([$chars]) .* \1 /x
}
abc
abb # NB: b wasn't in chars
abcd
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.