fork(1) download
  1. import re
  2. a = "hello word 123 with the 0x54673ef75e1a"
  3. a1 = "hello word 123 with the 0xf"
  4. a2 = "hello word 123 with the 0xea21f"
  5. a3 = "hello word 123 with the 0xfa"
  6. b = re.sub(r"(0x[\da-fA-F]+)|(\d+)","[0-9]",a)
  7. b1 = re.sub(r"(0x[\da-fA-F]+)|(\d+)","[0-9]",a1)
  8. b2 = re.sub(r"(0x[\da-fA-F]+)|(\d+)","[0-9]",a2)
  9. b3 = re.sub(r"(0x[\da-fA-F]+)|(\d+)","[0-9]",a3)
  10. print b
  11. print b1
  12. print b2
  13. print b3
Success #stdin #stdout 0.08s 10840KB
stdin
Standard input is empty
stdout
hello word [0-9] with the [0-9]
hello word [0-9] with the [0-9]
hello word [0-9] with the [0-9]
hello word [0-9] with the [0-9]