View Single Post
Old 06-05-2020, 07:40 PM   #4165
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,003
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Loba View Post
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?
JimmXinu is online now   Reply With Quote