I would add "how to reverse the sides of an equation" to this list. There are a few other handy tricks for coders, but this is the most common I can think of right now
Yes. If I understand you correctly, that would at the same time be a good example case for another detail I was about to suggest: Match-parenthesis references in the replacement.
Something like: "a = b + c".replace(/^(.+?) *= *(.+)$/, "$2 = $1")
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would add "how to reverse the sides of an equation" to this list. There are a few other handy tricks for coders, but this is the most common I can think of right now
Yes. If I understand you correctly, that would at the same time be a good example case for another detail I was about to suggest: Match-parenthesis references in the replacement.
Something like:
"a = b + c".replace(/^(.+?) *= *(.+)$/, "$2 = $1")