---- Sd He [email protected] wrote:
Why does the following only replace the first instance of the pattern?
‘|\ |\ |’.gsub(/|\ |/, “||”)
Because “\ |” will not match “|\ |”.
If you had made it ‘|\ ||\ |’, both will be replaced and you would have
had “||||”
-GregD