View Single Post
Old 05-06-2013, 05:30 PM   #1358
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,045
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Jade Aislin View Post
I had hoped that the first line would add (Friendship) to the end of the tag, instead it replaced the &. I also found at least one name in the pairing being deleted, although I haven't checked the rest of my code to find out why.
Only the part that matches the regex is replaced. If you want to add something to the end, you'll need to match the rest of the string. Something like this should work:

ships=>( )?(&|and)(.*?)$=>\1 \3 (Friendship)

Quote:
Originally Posted by Jade Aislin View Post
On another note, I ran into a couple errors when trying to download stories, unmatched group and invalid group reference. I'm not sure why I received these error. I didn't see any obvious similarity in the stories when I checked. Although one of the stories had the '|' in one of the fandoms that seabream mentioned. Is it a problem in my code somewhere? If so what should I be looking for?
There is a known issue(look for "Brief explanation") with python's regex library not handling group matching the same as everybody else.
JimmXinu is offline