title: regex for ls -ld
body: <p>I have a directory consists of different types of files, including directory and individual files with similar names - so pattern must be very exact. </p>
  
  <p>I need to use <strong>ls -ld</strong> to just to extract directories, and look for particular patterned directory. After getting this, I need to find out what that particular <strong>string_w_pattern</strong> is to store as variable.</p>
  
  <p>I am running this in sh. </p>
  
  <p>Known string is <strong>my_dir</strong> and <strong>my_prop_dir</strong></p>
  
  <pre><code>/my_dir/string_w_pattern/my_prop_dir
  </code></pre>
  
  <p><strong>string_w_pattern</strong> consists of 2-3 characters in capital letters with one number always comes on the second place. </p>
  
  <p>I have tried following but getting more than two output since names for <strong>string_w_pattern</strong> are similar. </p>
  
  <pre><code>ls -ld /my_dir/[A-Z]*[A-Z0-9]\/my_prop_dir
  </code></pre>