TheYour regular expression doesn't work because -D. gives an error, you don't want or need it thereis not a word character. That said, yesGrep only considers a-z, your regular expression should work. ApparentlyA-Z, it doesn't work with .0-9 for some reason:and _ to be word characters.
$ ls | grep '\<t' ## works as expected
test1
test2
$ ls | grep '\<\.' ## no output
In any case, this is really not the right way to do this. First of all, parsing ls is very fragile and almost never a good idea. Here are some other ways of listing directories whose name starts with a .:
find . -type d -name '.*'
Or, if you don't want it to descend into subdirectories (and if you have GNU find, the default on Linux):
find . -maxdepth 1 -type d -name '.*'
Alternatively, you could just use echo and a shell glob:
echo .*
That will also show files. To avoid that, use a loop like:
for i in .*; do [ -d "$i" ] && printf '%s\n' "$i"; done