title: jquery how to select <option> using Regex
body: <p>I would like to remove the years 2014 &amp; 2015 from both the check in and check out using Regex-</p>
  <p><img src="https://i.stack.imgur.com/UQGdm.jpg" alt="enter image description here" /></p>
  <p>I tried using containsRegex but I guess I'm doing something wrong:</p>
  <pre><code>$(&quot;option:containsRegex(/^((2014)|(2015))$/)&quot;).remove();
  </code></pre>
  <p>Here's the example code:</p>
  <pre><code>&lt;select name=&quot;check_in&quot; class=&quot;required&quot;&gt;
      &lt;option value=&quot;&quot;&gt;Year&lt;/option&gt;
          &lt;option value=&quot;2013&quot; selected=&quot;selected&quot;&gt;2013&lt;/option&gt;  
          &lt;option value=&quot;2014&quot;&gt;2014&lt;/option&gt;
          &lt;option value=&quot;2015&quot;&gt;2015&lt;/option&gt;
          &lt;option value=&quot;2016&quot;&gt;2016&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;select name=&quot;check_out&quot; class=&quot;required&quot;&gt;
      &lt;option value=&quot;&quot;&gt;Year&lt;/option&gt;  
          &lt;option value=&quot;2013&quot; selected=&quot;selected&quot;&gt;2013&lt;/option&gt;  
          &lt;option value=&quot;2014&quot;&gt;2014&lt;/option&gt;
          &lt;option value=&quot;2015&quot;&gt;2015&lt;/option&gt;   
          &lt;option value=&quot;2016&quot;&gt;2016&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  <p>I can do it like that:</p>
  <pre><code>$('option:contains(&quot;2014&quot;)').remove();
  $('option:contains(&quot;2015&quot;)').remove();
  </code></pre>
  <p>But I want to be able to do it using regex becuase the real file is more complicated than that..
  Here's the fiddle: <a href="http://jsfiddle.net/PJjGb/1/" rel="nofollow noreferrer">http://jsfiddle.net/PJjGb/1/</a> so you can try.</p>
  <p>To sum it up I want to remove certain 'option's of the 'select' element.
  and to be able to choose which option by using regex-
  In this example removing option '2014' and '2015' using regex from both check in and check out.
  Thank you.
  (Here I did that without regex: <a href="http://jsfiddle.net/PJjGb/" rel="nofollow noreferrer">http://jsfiddle.net/PJjGb/</a>)</p>