Simon discovers Python's re.split(). About one particular aspect of it (parenthesized groups are returned in the list), he says, "I'm probably the last person to find out about this", but in fact, I never even knew re.split() existed at all! I think I've wanted this functionality a half-dozen times in the past, and never thought to look in the re module to find it. Python's standard library is incredibly rich, and often solutions are hiding in places waiting for you to discover them.

tagged: python» react

Comments

Add a comment:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.