how to filter directory in linux

C++
#directory structure:
    - G10
    - G11
    - G12
    - thisDir
    
#command to enter to filter for all the G?? directories:
	ls -d G??
    
#entering this will return:
    - G10
    - G11
    - G12
Source

Also in C++: