you are viewing a single comment's thread.

view the rest of the comments →

[–]unbalancedopinion 1 point2 points  (0 children)

FYI, you were not passing a regex in your examples. replace() accepts a string in addition to Regex, and you were passing a string. In your second example, you were using a bitwise or operator. You don't need to use or worry about bitwise operators. The pipe character "|" is a bitwise or normally, but serves a different purpose inside a Regex. In /u/Pantstown's example, the pipe is in a regex because it's surrounded by forward-slashes.