<span style="font-family: courier new,monospace;">Today's regex problem is a standard problem, that has standard answers,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">I just don't know them, and I haven't found them...</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">"Strip comments from lines while obeying quoted strings".</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">I've got a fellow who's dealing with 'registry files', but needs to</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">strip comments off of the end of the lines (I.e. anything after a semicolon)</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">but preserve semicolons (and text) if found within a quoted string.</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">I know there are hard ways to do it, but there's got to be a module</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">to handle it for me.</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Here are some example strings:</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">key="value"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">key=value</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">key="value1;value2"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">key="value1;value2"     ; comment</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">key='value1;value2'     ; comment</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">"key"="value1"</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">"key"="value1"          ; comment</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">"key"="value1;value2"</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">"key"="value1;value2"   ; comment</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">"key"="val\"ue1;value2"</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">"key"="val\"ue1;value2" ; comment<br>"key"='val\'ue1;value2' ; comment<br>"key"='val\"ue1;value2' ; comment<br>

</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Suggestions?</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Fulko</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">