title: converting RegExp to String then back to RegExp
body: <p>So I have a RegExp <code>regex = /asd/</code></p>
  
  <p>I am storing it as a as a key in my key-val store system.</p>
  
  <p>So I say <code>str = String(regex)</code> which returns <code>"/asd/"</code>.</p>
  
  <p>Now I need to convert that string back to a RegExp.</p>
  
  <p>So I try: <code>RegExp(str)</code> and I see <code>/\/asd\//</code></p>
  
  <p>this is not what I want. It is not the same as <code>/asd/</code></p>
  
  <p>Should I just remove the first and last characters from the string before converting it to regex? That would get me the desired result in this situation, but wouldn't necessarily work if the RegExp had modifiers like <code>/i</code> or <code>/g</code></p>
  
  <p>Is there a better way to do this?</p>