title: Python regular expression to match a file name. Using os.walk() to get a file name
body: <p>I'm using os.walk() to get files name. What I need to do is to create a list with files name that match following patterns:</p>
  
  <p>if <code>'*'</code> will match all files.</p>
  
  <p>if <code>'h*'</code> will match all files beginning with h.</p>
  
  <p>if <code>'*h'</code> will match all files ending with h.</p>
  
  <p>if <code>'*h*'</code> will match all files that have h in them.</p>
  
  <p>if <code>[h-w]*</code> will match any one character in set, including set negation [^h-w] </p>
  
  <p>I'm new with regular expression and I have troubles with creating an if statement for this issue. May some explain it to me (maybe with code examples) how to do it. Thanks.</p>