<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
I found this:<br>
<a class="moz-txt-link-freetext" href="http://code.activestate.com/recipes/475109/">http://code.activestate.com/recipes/475109/</a><br>
<br>
But it is incorrect in some cases, such as:<br>
<b><br>
<tt>"foo \" bar"</tt></b> <i> (incorrectly matches "foo \")</i><br>
<b><tt><br>
'''</tt></b> <i>(incorrectly matches the second two single quotes)</i><br>
<br>
<tt><b>" foo<br>
bar "</b></tt> <i> (incorrectly matches quote containing newline</i>)<br>
<br>
Anyone know a regular expression that correctly matches python string
literals?<br>
<br>
Thanks in advance,<br>
Ken<br>
<br>
</body>
</html>