title: Random sample from regex
body: <p>I would like to test a tool on a small number of files from a directory. To run the tool on all files in the directory, I would run:</p>
  <p><code>./my-tool input/*.test</code></p>
  <p>However, the tool takes a long time to run and I would like to test it only on a subset of the files in <code>input/</code>. Currently, I am copying a random subset to another folder and using the regex to grab all files from that folder</p>
  <p>My question is: Is there any way to limit the regex matches? i.e. a way to run  <code>./my-tool input/[PATTERN].test</code> Where <code>[PATTERN]</code> is a regex that will expand to only be <code>n</code> matches. Even better, is there a way to do that <em>and</em> randomize which ones are returned?</p>