I have most of the coding done for my end tags, but I had a few questions.
1. In order to get the end tags to the end of a ship when there is more than one end tag, I had to duplicate a couple lines of code.
Code:
ships=> (\(Family\)|\(Friendship\))(.*?)$=>\2 \1
ships=> (\(Family\)|\(Friendship\))(.*?)$=>\2 \1
ships_LIST=>(\(Family\)|\(Friendship\))( )?(.*?),=>\3 \1,
ships_LIST=>(\(Family\)|\(Friendship\))( )?(.*?),=>\3 \1,
Is there a way to tell it to redo a line of code until it no longer finds what the code is looking for?
2. When I put in code for putting the end tag at the end for the final ship in the list, I had to delete a space from the code to make it work.
Code:
ships_LIST=>,(.*?)( \(Family\)| \(Friendship\))/(.*?)$=>,\1/\3\2
ships_LIST=>,(.*?)(\(Family\)|\(Friendship\))/(.*?)$=>,\1/\3 \2
Originally I tried to put in ( )? to show that the space might not be there.
Code:
ships_LIST=>,(.*?)(( )?\(Family\)|( )?\(Friendship\))/(.*?)$=>,\1/\3 \2
However, I received an unmatched group error when I added the '( )?'.
Is there a way I can streamline these two lines of code?
3. Finally, I used this code to separate end tags into different ships:
Code:
ships_LIST=>(.*?) \((.*?)\) \((.*?)\),=>\1 (\2), \1 (\3),
ships_LIST=>,(.*?) \((.*?)\) \((.*?)\)$=>,\1 (\2), \1 (\3)
The first line worked fine and 'A/B (Friend) (Family)' became: 'A/B (Friend), A/B (Family)'.
The second line, however, deleted the second end tag. 'C/D (Friend) (Family)' became: 'C/D (Friend)'.
I'm not sure why it deleted the second end tag. I also tested '\1 (\3), \1 (\2)' and still had the second tag deleted. I'm not really sure how to fix the last line to get the last ship in the list fixed.
Any help would be appreciated.