title: Regular expression for hidden files under unix
body: <p>I'm looking for a regex to match every file begining with a "." in a directory.</p>
  
  <p>I'm using CMake (from CMake doc : "CMake expects regular expressions, not globs") and want to ignore every file begining with a dot (hidden files) BUT <code>"\..*"</code> or <code>"^\..*"</code> doesn't work :(</p>
  
  <p>The strange thing : this works (thanks to rq's <a href="https://stackoverflow.com/questions/727075/regular-expression-for-hidden-files-under-unix/729082#729082">answer</a>) and remove every hidden files and temp files ("~" terminated files)</p>
  
  <pre><code>file(GLOB DOT ".*")
  file(GLOB TILD "*~")
  
  set (CPACK_SOURCE_IGNORE_FILES "${DOT};${TILD}")
  </code></pre>
  
  <p>But I can't find the right thing to write directly into <code>CPACK_SOURCE_IGNORE_FILES</code> to have the same result!</p>
  
  <p>Here is the  "<a href="http://www.cmake.org/Wiki/CMake:CPackConfiguration" rel="nofollow noreferrer">doc</a>" of this variable.</p>