Q:

design a regular expression to print out a list of words that start and end with the same 3 letters unix

design a regular expression to print out a list of words that start and end with the same 3 letters. For example: microcosmic, entrancement etc. i need it in unix.

A:

This is your first post .... you can use grep (GNU grep 2.16) 
grep -E "^(.{3}).*\1$" file.txt

input file.txt

microcosmic
hello
entrancement
world

you get,

microcosmic
entrancement

explanation

^     : beginning of line
(...) : backreference mark
.{3}  : first three letter
.*    : whatever
\1    : backreference
$     : ending of line

EDIT
if, you look for each word that start and end with the same 3 letters in a text
 echo "microcosmic gshgshi entrancement hello world" | 
 grep -E -o "\b(.{3})\S*\1\b"

you get,

microcosmic
entrancement

\b        : a regular expression means "word boundary"
\S        : It isn't blank space
-o option : Print only the matched

IMPORTANT NOTE 
Words like to abc or ababa It don't works, in this case you can use awk without regular expressions
echo "microcosmic gshgshi entrancement hello world abc ababa" |  
awk 'length($0)<3{next;}
     substr($0,1,3) == substr($0,length($0)-2,3)' RS="[ \n\t]+"

you get,

microcosmic
entrancement
abc
ababa

