title: Regex for dates in Clojure
body: <p>The format of dates I am looking to capture fall into permutations of the pattern "word/DD/YYYY" where word corresponds to months, i.e.</p>
  
  <pre><code>(def months ["january" "January" "february" "February" "march" "March" "April" "april" "may" "May" "june" "June" "july" "July" "august" "August" "september" "September" "october" "October" "november" "November" "december" "December"])
  </code></pre>
  
  <p>So, possible permutations of the above pattern would be "DD/word/YYYY" "YYYY/word/DD" and "YYYY/DD/word"</p>
  
  <p>I've tried something along the lines of </p>
  
  <pre><code>(def months-match (clojure.string/join "|" months))
  (def months-str (str "(\\s*(" months-match ")")) 
  (def moster (re-pattern  months-str))
  
  (defn foomonths [s]
  (map first (re-seq moster s)))
  </code></pre>
  
  <p>with plans to add the regex for days and years</p>
  
  <pre><code>|[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d
  </code></pre>
  
  <p>Permuting the regex has not been an issue. Rather it is the process of formulating months that are words into a regex structure with the days and years in digits. </p>