User:HighwindBot/EpisodeReferenceTemplate

Function
Replaces all simple episode references with a template call. "Simple" references are:
 * (SER: "EPISODE")
 * (SER: "EPISODE")

Code snippet
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''), (u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?)\|([^\[]*?)\]\]\"\)', r''), (u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?)\]\]\"\)', r''), ],   },