abcdecgfhas 7 unique letters.
A single regexp would be too convoluted I guess (I say that only because such a regexp is beyond my skills :-) update: or laziness :-)
#!/usr/bin/perl -nl if (length == 8) { $c = substr ($_, 2, 1); if (substr ($_, 5, 1) eq $c) { my %h; @h{split//,$_} = (1) x 8; print if keys %h == 7; } } __END__ perl match.pl /usr/share/dict/words Abednego abscised Acadians Acadia's Acalia's acerbest Adaiha's Adalia's Adelbert ... whirling whisking Wieche's wielders Winton's worker's writhing Yahweh's Yeargain Ygerne's Yorker's Zarger's Ziegfeld
update: changed to -nl to apply on /usr/share/dict/words
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re^3: Regex help
by shmem
in thread Regex help
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |