Popular recipes tagged "structured"http://code.activestate.com/recipes/tags/structured/popular/2011-05-18T13:04:01-07:00ActiveState Code RecipesExtracting structured text or code (Python)
2011-05-18T13:04:01-07:00Mike Sweeneyhttp://code.activestate.com/recipes/users/4177990/http://code.activestate.com/recipes/577700-extracting-structured-text-or-code/
<p style="color: grey">
Python
recipe 577700
by <a href="/recipes/users/4177990/">Mike Sweeney</a>
(<a href="/recipes/tags/parsing/">parsing</a>, <a href="/recipes/tags/structured/">structured</a>, <a href="/recipes/tags/text_processing/">text_processing</a>, <a href="/recipes/tags/token/">token</a>).
Revision 2.
</p>
<p>This function uses the power of regular expressions to extract parts of a structured text string. It can build a token list from many types of code and data formats. It finds string types (with quotes) and nested structures that use parentheses, brackets, and braces. If you need to extract a different syntax, you can provide a custom token pattern in the function arguments.</p>