Okay, here is my string I'm working with.
"Todd taught me to move towards upper right-hand side to attack and kill #bJr. Sentinel#k"
I want it to turn into this:
"Todd taught me to move towards upper right-hand side to attack and kill [b]Jr. Sentinel[/b]"
Here's how I'm currently doing it:
Regular expression --> #b[\w ]*#k
Then snip off the ends (#b and #k)
Then add my tags ([b] and [/b])
Then do a string replace("[b]Jr. Sentinel[/b]" for "#bJr. Sentinel#k")
There's got to be a faster, more efficient way of doing this in Python. Any ideas?
Bookmarks