Skip to content

Instantly share code, notes, and snippets.

@kdonaldson
Created March 26, 2013 13:58
Show Gist options
  • Save kdonaldson/5245571 to your computer and use it in GitHub Desktop.
Save kdonaldson/5245571 to your computer and use it in GitHub Desktop.
Regex-based tokenizer keeping delimiters
import re
re.compile(r'(\s+)').split(<some string>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment