title: Regex inside javascript string
body: <p>I have a form that needs to be implemented through javascript:</p>
  <pre><code>var birthdayForm = '&lt;form id=&quot;birthday_signup&quot; class=&quot;klaviyo_gdpr_embed_Wh3QTB&quot; style=&quot;margin-top: 40px;&quot; action=&quot;//manage.kmail-lists.com/subscriptions/subscribe&quot; data-ajax-submit=&quot;//manage.kmail-lists.com/ajax/subscriptions/subscribe&quot; method=&quot;GET&quot; target=&quot;_blank&quot; novalidate=&quot;novalidate&quot;&gt;'+
  '&lt;input type=&quot;hidden&quot; name=&quot;g&quot; value=&quot;Wh3QTB&quot;&gt;'+
  '&lt;input type=&quot;hidden&quot; name=&quot;$fields&quot; value=&quot;Birthday&quot;&gt;'+
  '&lt;input type=&quot;hidden&quot; type=&quot;text&quot; name=&quot;Birthday&quot; id=&quot;final_birthday&quot;&gt;'+
  '&lt;div class=&quot;klaviyo_field_group&quot;&gt;'+
  '&lt;h2&gt;Vertel ons jouw verjaardag en we zorgen voor een leuke verrassing!&lt;/h2&gt;'+
  '&lt;input class=&quot;&quot; style=&quot;display:none;&quot; type=&quot;email&quot; value=&quot;&quot; name=&quot;email&quot; id=&quot;k_id_email&quot; placeholder=&quot;Your email&quot; /&gt;'+
  '&lt;div class=&quot;klaviyo_field_group klaviyo_form_actions&quot;&gt;'+
  '&lt;div class=&quot;klaviyo_field_group&quot; style=&quot;margin: 10px 0;&quot;&gt;'+
  '&lt;input id=&quot;klaviyo_form_Birthday&quot; oninput=&quot;this.value = this.value.replace(/[^0-9\/.]/g, \'\').replace(/(\..*)\./g, \'$1\');&quot; placeholder=&quot;dd/mm/yyyy&quot; maxlength=&quot;10&quot; type=&quot;text&quot; /&gt;'+
  '&lt;button type=&quot;submit&quot; class=&quot;klaviyo_submit_button btn&quot; style=&quot;margin-left: 15px;&quot;&gt;Versturen&lt;/button&gt;'+
  '&lt;/div&gt;'+
  '&lt;/div&gt;'+
  '&lt;/div&gt;'+
  '&lt;div class=&quot;klaviyo_messages&quot;&gt;'+
  '&lt;div class=&quot;success_message&quot; style=&quot;display:none;&quot;&gt;'+
  '&lt;p class=&quot;thank_you&quot;&gt;Bedankt om jouw verjaardag te delen!&lt;/p&gt;'+
  '&lt;/div&gt;'+
  '&lt;div class=&quot;error_message&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;'+
  '&lt;/div&gt;'+
  '&lt;div class=&quot;klaviyo_form_actions&quot; style=&quot;margin: 10px 0;&quot;&gt;'+
  ''+
  '&lt;/div&gt;'+
  '&lt;/form&gt;';
  </code></pre>
  <p>As you can see, the following regex is beig executed on &quot;oninput&quot;:</p>
  <pre><code>oninput=&quot;this.value = this.value.replace(/[^0-9\/.]/g, \'\').replace(/(\..*)\./g, \'$1\');&quot;
  </code></pre>
  <p>Unfortunately, this breaks. It's probably not being escaped correctly. I fail to see how exactly though. Can anyone help me?</p>