Ok say I have a string in python:
str="martin added 1 new photo to the <a href=''>martins photos</a> album."
the string contains a lot more css/html in real world use
What is the fastest way to change the 1 ('1 new photo'
) to say '2 new photos'
. of course later the '1'
may say '12'
.
Note, I don't know what the number is, so doing a replace is not acceptable.
I also need to change 'photo'
to 'photos'
but I can just do a .replace(...)
.
Unless there is a neater, easier solution to modify both?