View Single Post
Old 03-14-2021, 05:14 AM   #5653
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by ownedbycats View Post
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".
davidfor is offline   Reply With Quote