How to write a regular expression correctly?

  • 0
    In the string, you need to replace everything that is not numbers with a blank, the equal sign = and plus +
    To do this, I need a regular expression "everything that is not numbers, replace the equal sign and the plus sign with empty space.
    replace (reg, "")

    I can leave only plus I can separately - (/ [^ +] / g)
    and only numbers I can - (/ [^ 0-9] / g)
    But to collect everything in a heap does not work
    JavaScript Emily Thompson, Jul 16, 2020

  • 1 Answers
  • 0
    (/ [^ 0-9 + =] / g)
    Jack Valentine

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!