LHUHCD wrote:
> Is there a regular expression that can find duplicate characters in a word?
Normally I love these types of problems and would jump right in. But
this one has two problems. One is that it was sent to bug-bash which
is a mailing list for discussion about bugs and features in the bash
shell and your question is off-topic since it has nothing to do with
bash. A better place to have asked your question would be
help-gnu-utils which is a generic discussion list for all of the gnu
utilities which would include grep.
Secondly this sounds very suspiciously like a homework assignment. :-)
Bob
> For example, for five-letter words, we would use.....
> grep "^.....$"
> .....to find any five character word
>
> How can we, at least, find five-letter words with duplicate letters in the
> word using grep in bash?
>
> ample - no
> apple - yes
> pills - yes
> civic - no (two pairs of duplicates)
> alana - no (includes "triplicate")
>
> At the very least, I am looking for a grep that finds words with at least a
> duplicate letter inside the word.
>
> Thanks!
>
>
> --
> View this message in context:
http://old.nabble.com/Using-grep-to-find-duplicate-characters-in-a-word-in-bash-tp26202300p26202300.html> Sent from the Gnu - Bash mailing list archive at Nabble.com.