String Replacement
subhabangalore at gmail.com
subhabangalore at gmail.com
Mon Jan 23 16:23:38 EST 2017
I have a string like
"Trump is $ the president of USA % Obama was $ the president of USA % Putin is $ the premier of Russia%"
Here, I want to extract the portions from $...%, which would be
"the president of USA",
"the president of USA",
"the premier of Russia"
and would work some post extraction jobs, like I may split them or annotate them and may replace them
back to its own position with the edited string.
In the end it may look like
"Trump is the/DET president/NN of/PREP USA/NN Obama was the/DET president/NN of/PREP USA/NN Putin is the/DET premier/NN of/PREP Russia/NN"
I am working around replace and re.sub
If any one may kindly suggest.
I am using Python2.7.12 on MS-Windows 7
Thanking in Advance
More information about the Python-list
mailing list