<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: python code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 21 Aug 2008 11:22:05 GMT</pubDate>
    <description>DZone Snippets: python code</description>
    <item>
      <title>Python regular expressions</title>
      <link>http://snippets.dzone.com/posts/show/72</link>
      <description>How to match a simple stuff in python:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import re&lt;br /&gt;rg = re.compile("delete change (\d+) ")&lt;br /&gt;m = rg.match("l.cpp#21 - delete change 20007 (t")&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Then:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt;&gt;&gt; m.group(0)&lt;br /&gt;'delete change 20007 '&lt;br /&gt;&gt;&gt;&gt; m.group(1)&lt;br /&gt;'20007'&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;rg.search() is similar to rg.match(), but only matches things at the beginning of the string i.e. it would match "delete change 20 " but not "foo delete change 20 ".&lt;br /&gt;</description>
      <pubDate>Fri, 08 Apr 2005 06:50:12 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/72</guid>
      <author>kjk (Krzysztof Kowalczyk)</author>
    </item>
  </channel>
</rss>
