title: Is Java Regex Thread Safe?
body: <p>I have a function that uses <code>Pattern#compile</code> and a <code>Matcher</code> to search a list of strings for a pattern.  </p>
  
  <p>This function is used in multiple threads. Each thread will have a unique pattern passed to the <code>Pattern#compile</code> when the thread is created.  The number of threads and patterns are dynamic, meaning that I can add more <code>Pattern</code>s and threads during configuration.</p>
  
  <p>Do I need to put a <code>synchronize</code> on this function if it uses regex?  Is regex in java thread safe?</p>