Quote:
Originally Posted by Jade Aislin
Code:
ships_LIST=>\((.*?)\)( )?(.*?),=>\3 (\1),
ships_LIST=>\((.*?)\)( )?(.*?)$=>\3 (\1)
However the second line, used for the last ship in the list, is moving the parenthesis tag, but it is not getting rid of the original parenthesis. My output goes from 'O (One-Sided) (Family)/P' to 'O (One-Sided) (Family)/P (One-Sided)'.
Is there a reason that the last line of code is moving the tag I want, but is not deleting it from the original position?
|
\((.*?)\) matches (non-greedy)
(something)
(.*?) matches (non-greedy) anything--including additional
(something) strings.
I'd experiment with using something like
([^\(]*?)--match (non-greedy) anything
except open paren.
Frankly, there's a lot of trial and error in using complex regular expressions, even for experienced users.