fork(2) download
  1. import re
  2. p = re.compile(r'test\s*:\s*(.*)')
  3. s = "test : match this."
  4. m = p.search(s) # Run a regex search anywhere inside a string
  5. if m: # If there is a match
  6. print(m.group(1)) # Print Group 1 value
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
match this.