I have a regex like this
value = ">>897897"
rep = "<div> \\1 </div>"
pat = ">>(\\d+)"
res = re.sub(pat, rep, value)
But now I want to add a condition that when the number equals a certain number, like 50, it uses a different substition.
For example if match equals 50:
use
rep = "<p> \\1 </p>"
instead of
rep = "<div> \\1 </div>"