Quote:
Originally Posted by Loba
I wonder if anyone can give me some feedback on my replace metadata syntax. I am attempting to normalize my ratings across sites and when scraping Not Rated fics it is applying "Not Mature".
|
Code:
rating=>^FR18|M(ature)?|R(.*)?$=>Mature
R(.*)?$ is matching 'Rated' and replacing it with Mature.
Applying grouping forces it to treat the $ anchor for the whole pattern, not just the last part:
Code:
rating=>^(FR18|M(ature)?|R(.*)?)$=>Mature
You should do that for others, too.
I'm honestly not sure why this is happening--it doesn't require the grouping when I test it directly in Python 3.7. Might be a py2 vs py3 thing?