fork download
  1. import re
  2. strs = ['hello.world','hello\.world','hello,world']
  3. for s in strs:
  4. res = re.split(r'(?<!\\)\.', s)
  5. print(res)
  6. print("-------------")
  7.  
  8. a = ["hello\.world12"]
  9. print(a)
  10. print(a[0])
Success #stdin #stdout 0.04s 9700KB
stdin
Standard input is empty
stdout
['hello', 'world']
-------------
['hello\\.world']
-------------
['hello,world']
-------------
['hello\\.world12']
hello\.world12