Quote:
Originally Posted by ownedbycats
Any idea why this replace_metadata would fail to remove " (Fandom)"? Regex101 indicates that the pattern matches.
Code:
## Character standardization and dedepublication
## Removing some fandoms first
characters=>\s(\(Elder Scrolls\)|\(Fallout\)|\(Mass Effect\)|\(Skyrim\))$=>
This works but leaves behind an extraneous space:
Code:
characters=>\(Elder Scrolls\)|\(Fallout\)|\(Mass Effect\)|\(Skyrim\)$=>
|
The second one is not matching a space before the fandom names that you are looking for. The first one is to match "a space followed by one of these fandom names". The second it to just match the fandom names.
The first one is probably the correct one, but, it assumes that there is always a space. You might need to cater for when there is no space, or multiple spaces.
@ackomb: "extraneous" is "irrelevant or unrelated to the subject being dealt with". In this case, "extra space" or "unwanted space" might be better. But, what I would probably say is, "doesn't get rid of the ^%#$$@ space before the fandoms".