fork download
  1. import re
  2.  
  3. should_match = r'.\asdf\fdsa'
  4. shouldnt_match = r'potatos'
  5.  
  6. print(re.match(r'^\.\\', should_match))
  7. print(re.match(r'^\.\\', shouldnt_match))
  8.  
  9. print(re.match(".\\.*", should_match))
  10. print(re.match(".\\.*", shouldnt_match))
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
<_sre.SRE_Match object; span=(0, 2), match='.\\'>
None
<_sre.SRE_Match object; span=(0, 1), match='.'>
<_sre.SRE_Match object; span=(0, 1), match='p'>