bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using grep to find duplicate characters in a word in bash


From: LHUHCD
Subject: Using grep to find duplicate characters in a word in bash
Date: Wed, 4 Nov 2009 10:44:55 -0800 (PST)

Is there a regular expression that can find duplicate characters in a word?  

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]