Removing commas from inside quoted parts of a string in Elm 0.16
<p>Right now I am trying to remove any commas that are contained within quotation marks and replace them with spaces in this string:</p>

<p>(,(,data,"quoted,data",123,4.5,),(,data,(,!@#,(,4.5,),"(,more","data,)",),),)</p>

<p>I am currently using this function that uses Javascript style regex: </p>

<pre><code>removeNeedlessCommmas sExpression =
    sExpression
      |&gt; (\_ -&gt; replaceSpacesWithCommas sExpression)
      |&gt; Regex.replace Regex.All (Regex.regex ",") (\_ -&gt; ",(?!(?:[^"]*"[^"]*")*[^"]*$)g")
</code></pre>

<p>This regex is displayed as working correctly in sites such as <a href="https://regex101.com/" rel="nofollow">regex101.com</a>. </p>

<p>However, I have tried many ways of escaping the regex so that it works in Elm 0.16, but the rest of my code in my file is always still highlighted like the rest of the file is enclosed in a string. This is the error that I am getting with my current code:</p>

<pre class="lang-none prettyprint-override"><code>(line 1, column 64): unexpected "_" expecting space, "&amp;" or escape code

39│     printToBrowser "((data \"quoted data\" 123 4.5) (data (!@#(4.5) \"(more\" \"data)\")))"

Maybe &lt;http://elm-lang.org/docs/syntax&gt; can help you figure it out.
</code></pre>

<p>I will post the main function that the error is referring to so that it makes more sense:</p>

<pre><code>main : Html.Html
main =
    printToBrowser "((data \"quoted data\" 123 4.5) (data (!@# (4.5) \"(more\" \"data)\")))"
</code></pre>

<p>Any assistance would be greatly appreciated. Thanks in advance.</p>