Quote:
Originally Posted by MimiRose113
I'm having trouble with a piece of my coding, it used to work, I'm sure, or else I'm going mad.
If ships contains a platonic relationship such as 'Fili & Kili' I want to split this into just the characters 'Fili, Kili'.
So I have
ships=>(.*) (amp;|&) (.*)=>\1\,\2
I've tried this in add_to_replace_metadata and in replace metadata and it still pulls through as 'Fili & Kili'.
|
You probably want something more like
ships=>(.+) ?(&|&) ?(.+)=>\1\,\2
FYI, if you search the thread for ships2chars, that's a very similar thing that's been done before. Here's one version I found:
Code:
add_to_extra_valid_entries:,ships2chars
include_in_ships2chars:ships.NOREPL
# NOREPL prevents any ships patterns from being applied to ships2chars.
add_to_replace_metadata:
ships2chars=>[ ]*/[ ]*=>/
ships2chars=>[ ]*&[ ]*=>/
ships2chars=>([^/]+)/([^/]+)/([^/]+)/(.+)=>\1\,\2\,\3\,\4
ships2chars=>([^/]+)/([^/]+)/(.+)=>\1\,\2\,\3
ships2chars=>([^/]+)/(.+)=>\1\,\2
include_in_characters:characters,ships2chars