Environment: Win 7; Python 2.76
I want to split a long string into pieces, according to given separator
The string looks like:
“C-603WallWizard45256CCCylinders:2HorizontalOpposedBore:1-1/42006Stroke:1-1/8Length: SingleVerticalBore:1-111Height:6Width:K-720Cooling:AirWeight:6LBS1.5H.P.@54500RPMC-60150ccGas2007EngineCylinder:4VerticalInline2008Bore:1Stroke:1Cycle:42007Weight:6-1/2LBSLength:10Width: :AirLength16Cooling:AirLength:5Width:4L-233Height:6Weight: 4TheBlackKnightc-609SteamEngineBore:11/16Stroke:11/162008Length:3Width:3Height:4TheChallengerC-600Bore:1Stroke:1P-305Weight:18LBSLength:12Width:7Height:8C-606Wall15ccGasEngineJ-142Cylinder:SingleVerticalBore:1Stroke:1-1/8Cooling:1Stroke:1-1/4HP:: /4Stroke:1-7/:6Width:6Height:92006Weight:4LBS1.75H.P.@65200RPM”
The separator
are: [‘2006’, ‘2007’, ‘2008’, ‘2009’]
How is it possible to achieve?
Update
I've checked the post Split Strings with Multiple Delimiters? before however I don't think the need is the same as the post is about how to split a string into words. Mine's above is a split according to elements in a list.