Given a "dictionary" compromised of entries that are valid regex, e.g.:
CARS?|(AUTO|BIG)?TRUCK|VEHICLE|(CRUISE|CONTAINER)? SHIP|AUTOMOTIVE
Within python, how could I go about separating every entry or "dictionary value" onto its own line? I can't simply split by |
, because if you look at one entry value as itself, (AUTO|BIG)?TRUCK
, that would break the value because it contains the same character.
I am not trying to just match these characters, I am also additionnally trying to replace them.