title: How to apply list of regex pattern on list
body: <p>I have a list of strings and a list of patterns
  like: </p>
  
  <pre><code>links &lt;- c(
  "http://www.google.com"
  ,"google.com"
  ,"www.google.com"
  ,"http://google.com"
  ,"http://google.com/"
  ,"www.google.com/#"
  ,"www.google.com/xpto"
  ,"http://google.com/xpto"
  ,"http://google.com/xpto&amp;utml"
  ,"www.google.com/gclid=102938120391820391+ajdakjsdsjkajasn_JAJSDSJA")
  
  patterns &lt;- c(".com$","/$")
  </code></pre>
  
  <p>what i want is wipe out all links that matches this patterns.
  and get this result:</p>
  
  <pre><code>"www.google.com/#"
  "www.google.com/xpto"
  "http://google.com/xpto"
  "http://google.com/xpto&amp;utml"
  "www.google.com/gclid=102938120391820391+ajdakjsdsjkajasn_JAJSDSJA"
  </code></pre>
  
  <p>if i use</p>
  
  <pre><code>x&lt;-lapply (patterns, grepl, links) 
  </code></pre>
  
  <p>i get</p>
  
  <pre><code>[[1]]
   [1]  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE
  
  [[2]]
   [1] FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE
  </code></pre>
  
  <p>what takes me to this 2 lists</p>
  
  <pre><code>&gt; links[!x[[2]]]
  [1] "http://www.google.com"                                             "google.com"                                                       
  [3] "www.google.com"                                                    "http://google.com"                                                
  [5] "www.google.com/#"                                                  "www.google.com/xpto"                                              
  [7] "http://google.com/xpto"                                            "http://google.com/xpto&amp;utml"                                      
  [9] "www.google.com/gclid=102938120391820391+ajdakjsdsjkajasn_JAJSDSJA"
  
  
  &gt; links[!x[[1]]]
  [1] "http://google.com/"                                                "www.google.com/#"                                                 
  [3] "www.google.com/xpto"                                               "http://google.com/xpto"                                           
  [5] "http://google.com/xpto&amp;utml"                                       "www.google.com/gclid=102938120391820391+ajdakjsdsjkajasn_JAJSDSJA"
  </code></pre>
  
  <p>in this case each result list wiped 1 pattern out.. but i wanted 1 list with all patterns wiped... how to apply the regex to only one result ... or somehow to merge the  n boolean vectors always choosing  true.
  like:</p>
  
  <pre><code>b[1] &lt;- c(TRUE,FALSE,FALSE,TRUE,FALSE)
  b[2] &lt;- c(FALSE,FALSE,TRUE,TRUE,FALSE)
  b[3] &lt;- c(FALSE,FALSE,FALSE,FALSE,FALSE)
  
  res &lt;- somefunction(b)
  res 
  TRUE,FALSE,TRUE,TRUE,FALSE
  </code></pre>