I was getting everything from before but not after until I added the g at the end. But then I was thinking: Why is this working at all? Doesn’t the | (pipe) mean “or” shouldn’t it take of from either the front OR the end?
do you mean something like /a|b/?
the thing is that if you let it like that it will match or just the a or just the b
for example, if you have a word like barabba the regex like that will match only one letter. If you add the g it will match b, a, a, b, b, a
try using the match method and look at the resulting array - that is what the replace method will change
Exactly: /a | b/ means a or b. I thought if a matches it ignores b. So why does it return both a and b? Or does the g mean that it applies the a or b test to the whole string? I guess it must. Now I get it, arghh. Thx
BTW. What’s the trick to get monospace for excerpts when writing in this forum?