fork(3) download
  1. import re
  2. s='''A body paragraph about other things. Lorem ipsom and all that
  3.  
  4. **HEADERONE**
  5. - [x] Logged In
  6. - [ ] Logged Out
  7. - [x] Spun Around
  8. - [x] Did the hokey pokey
  9.  
  10. Maybe a link here www.go_ogle.com
  11.  
  12. Another list that isn't important
  13. - [ ] Thing one
  14. - [ ] Thing two
  15. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo '''
  16.  
  17. m = re.search(r'^\*\*HEADERONE\*\*(?:\r?\n-\s*\[[^][]*].*)*', s, re.M)
  18. if m:
  19. print(m.group())
Success #stdin #stdout 0.04s 9548KB
stdin
Standard input is empty
stdout
**HEADERONE**
- [x] Logged In
- [ ] Logged Out
- [x] Spun Around
- [x] Did the hokey pokey