I am trying to make a very simple regex replacement. Multiple others similar to this one work, but not this one.
I want every occurrence of either "/\" or "JI" character sequences to be replaced with "X". So, "/\JI" must turn into "XX".
However, here's what happens:
>>> import re
>>> phrase = '/\JI'
>>> phrase = re.sub('\/\\|JI', 'X', phrase)
>>> phrase
'/\\JI'
Why does it not detect either of the combinations and adds that second slash? regex101.com shows 2 full matches with the same string and same regex.