title: Slow rendering using Regex instead of contains() in String
body: <p>I have a block of code that's containing a lot of conditions with "contains()" in a String. I'm trying to make it so easier using regex but it take a lot of time to render (<code>SocketTimeoutException</code>).</p>
  
  <p>Old code : </p>
  
  <pre><code>if (!url.toLowerCase().contains("wikipedia")
                              &amp;&amp; !URL.toLowerCase().contains("vikidia")
                              &amp;&amp; !URL.toLowerCase().contains("wikimini")
                              &amp;&amp; !URL.toLowerCase().contains("dictionnaire")
                              &amp;&amp; !URL.toLowerCase().contains("dictionary")
                              &amp;&amp; !URL.toLowerCase().contains("traduction")
                              &amp;&amp; !URL.toLowerCase().contains("wiktionary")
                              &amp;&amp; !URL.toLowerCase().contains("academia.edu")
                              &amp;&amp; !URL.toLowerCase().contains("about.me")
                              &amp;&amp; !URL.toLowerCase().contains("facebook")
                              &amp;&amp; !URL.toLowerCase().contains("linkedin")
                              &amp;&amp; !URL.toLowerCase().contains("viadeo")
                              &amp;&amp; !URL.toLowerCase().contains("flickr")
                              &amp;&amp; !URL.toLowerCase().contains("google+")
                              &amp;&amp; !URL.toLowerCase().contains("plus.google")
                              &amp;&amp; !URL.toLowerCase().contains("instagram")
                              &amp;&amp; !URL.toLowerCase().contains("linkedin")
                              &amp;&amp; !URL.toLowerCase().contains("netlog")
                              &amp;&amp; !URL.toLowerCase().contains("orkut")
                              &amp;&amp; !URL.toLowerCase().contains("pinterest")
                              &amp;&amp; !URL.toLowerCase().contains("twitter")
                              &amp;&amp; !URL.toLowerCase().contains("tripadvisor")
                              &amp;&amp; !URL.toLowerCase().contains("youtube")
                              &amp;&amp; !URL.toLowerCase().contains("vimeo")
                              &amp;&amp; !URL.toLowerCase().contains("dailymotion")
                              &amp;&amp; !URL.toLowerCase().contains("pagesjaunes")
                              &amp;&amp; !URL.toLowerCase().contains("indeed")
                              &amp;&amp; !URL.toLowerCase().contains("jobteaser.com")
                              &amp;&amp; !URL.toLowerCase().contains("mappy.com")
                              &amp;&amp; !URL.toLowerCase().contains("slideshare")
                              &amp;&amp; !URL.toLowerCase().contains("meteofrance.com")
                              &amp;&amp; !URL.toLowerCase().contains("linternaute.com")
                              &amp;&amp; !URL.toLowerCase().contains("news.google")
                              &amp;&amp; !URL.toLowerCase().contains("persee.fr") // portail de revues en sciences humaines et sociales
                              &amp;&amp; !URL.toLowerCase().contains("/downloads") // the url for downloading 
                              &amp;&amp; !URL.toLowerCase().contains("/streaming")
                              &amp;&amp; !URL.toLowerCase().contains("http://stackoverflow.com/")
                              &amp;&amp; !URL.endsWith("pdf")
                              &amp;&amp; !URL.endsWith("txt")
                              &amp;&amp; !URL.endsWith("ps")
                              &amp;&amp; !URL.endsWith("dwf")
                              &amp;&amp; !URL.endsWith("klm")
                              &amp;&amp; !URL.endsWith("kmz")
                              &amp;&amp; !URL.endsWith("xls")
                              &amp;&amp; !URL.endsWith("xlsx")
                              &amp;&amp; !URL.endsWith("ppt")
                              &amp;&amp; !URL.endsWith("pptx")
                              &amp;&amp; !URL.endsWith("doc")
                              &amp;&amp; !URL.endsWith("docx")
                              &amp;&amp; !URL.endsWith("rtf")
                              &amp;&amp; !URL.endsWith("swf")
                              &amp;&amp; !URL.contains(".en.")
                              &amp;&amp; !URL.contains("/en/")
                              &amp;&amp; !URL.contains("/en.")
                              &amp;&amp; !URL.contains("books.")
                              &amp;&amp; !URL.contains("forum.")
                              &amp;&amp; !URL.contains("forum")
                              &amp;&amp; !URL.contains("blog.")
                              &amp;&amp; !URL.contains("infogreffe.fr/") //to test
                              &amp;&amp; !URL.contains("bing.com/images")) {
  
                          if (!URL.matches(".*\\btraduction\\b.*")) {
  ...
                      }
  </code></pre>
  
  <p>Refacted one :</p>
  
  <pre><code>if (!URL.toLowerCase().matches("^.*(wikipedia|vikidia|wikimini|dictionnaire|dictionary|traduction|wiktionary|(academia.edu)|(about.me)|facebook|linkedin|viadeo|flickr|(google+)|instagram|(plus.google)|linkedin|netlog|orkut|pinterest|twitter|tripadvisor|youtube|(vimeo+)|dailymotion|pagesjaunes|indeed|(jobteaser.com)|(mappy.com)|slideshare|(meteofrance.com)|(linternaute.com)|(news.google)|(persee.fr)|(/downloads)|(/streaming)|(stackoverflow.com)|pdf|txt|ps|dwf|klm||xls|xlsx|ppt|pptx|doc|docx|rtf|swf|(.en.)|(/en/)|(books.)|(forum.)|(blog.)|(infogreffe.fr/)|(bing.com/images)).*$")
                              ) {...}
  </code></pre>
  
  <p>Do you have any better idea to refactor the old one. Thank you so much</p>