1 Reply Latest reply on Jan 28, 2016 2:21 PM by pixxxel schubser

    Front slash regular expression?

    KuddRoww Level 1

      I'm trying to use a regular expression to replace all of the forward slashes in a selection.

       

      I've tried the following, my desired output is 0 m[div]s + 16.67 m[div]s.

       

      var str = "0 m/s + 16.67 m/s";
      var output = str.contents.replace(/[/]/gi,"[div]"); //output "0 m/s + 16.67 m/s"
      

       

      Thanks in advance for any helping is solving this.