<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 5: invalid regex substitution for table names in get_tables</title><link href="https://sourceforge.net/p/sqlcockpit/bugs/5/" rel="alternate"/><link href="https://sourceforge.net/p/sqlcockpit/bugs/5/feed.atom" rel="self"/><id>https://sourceforge.net/p/sqlcockpit/bugs/5/</id><updated>2014-10-06T19:02:19.100000Z</updated><subtitle>Recent changes to 5: invalid regex substitution for table names in get_tables</subtitle><entry><title>invalid regex substitution for table names in get_tables</title><link href="https://sourceforge.net/p/sqlcockpit/bugs/5/" rel="alternate"/><published>2014-10-06T19:02:19.100000Z</published><updated>2014-10-06T19:02:19.100000Z</updated><author><name>Alex</name><uri>https://sourceforge.net/u/pktm/</uri></author><id>https://sourceforge.net081e5573fcb580adf759953edafa1e3290f09c2d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In get_tables in sqlcockpit.pl there is a regex that should beautify table names:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="n"&gt;tables&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;beautify&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;".+"&lt;/span&gt;&lt;span class="p"&gt;)(.&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="c1"&gt;//g;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This regex does not work if the prefix and the table names are quoted, e.g. "thisisa"."test".&lt;br /&gt;
As a result, the table name is wrong and loading an SQLite database fails.&lt;/p&gt;
&lt;p&gt;Exclusing quotes between quotes does the trick (I think).&lt;br /&gt;
Just replace &lt;br /&gt;
s/(".+")(.+)/$2/g;&lt;br /&gt;
by &lt;br /&gt;
s/("&lt;span&gt;[^"]&lt;/span&gt;+")(.+)/$2/g;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>