Revision 1 as of 2004-12-12 04:30:56

Clear message

You can search or match.

You can also split on a pattern.

For example:

   1 import re
   2 split_up = re.split( r"(\(\([^)]+\)\))",
   3                      "This is a ((test)) of the ((emergency broadcasting station.))" )

...which produces:

["This is a ", "((test))", " of the ", "((emergency broadcasting station.))" ]

Unable to edit the page? See the FrontPage for instructions.