HighwindBot/EpisodeReferenceTemplate
Discuss0
35,784pages on
this wiki
this wiki
< User:HighwindBot
Revision as of 11:22, January 18, 2007 by Cid Highwind (Talk | contribs)
Function
Edit
Replaces all simple episode references with a template call. "Simple" references are:
- ([[SER]]: "[[EPISODE]]")
- ([[SER]]: "[[EPISODE (episode)|EPISODE]]")
Code snippet
Edit
The following can be added to the fixes at fixes.py, then be called using
- replace.py -fix:epref.
'epref': {
'regex': True,
'msg': {
'en':u'episode reference template',
},
'replacements': [
(u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?) \(episode\)\|\\2\]\]\"\)', r'({{\1|\2}})'),
(u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?)\|([^\[]*?)\]\]\"\)', r'({{\1|\2}})'),
(u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?)\]\]\"\)', r'({{\1|\2}})'),
],
},