<?xml version="1.0" encoding="windows-1252"?>
<node id="996671" title="Re^4: Regex to strip comments (out not in)" created="2012-10-01 10:53:58" updated="2012-10-01 10:53:58">
<type id="11">
note</type>
<author id="22609">
tye</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;blockquote&gt;
(And, despite the OP's claim, '*/' in a string literal isn't a problem.)
&lt;/blockquote&gt;&lt;i&gt;
The OP didn't identify the language involved, so I took him at his word.
&lt;/i&gt;&lt;/blockquote&gt;&lt;p&gt;
No offense intended, but that's hilarious. If you took them at their word with regard to '*/', then you must not have with regard to '/*'.
&lt;/p&gt;&lt;blockquote&gt;&lt;i&gt;
Seems I don't have the 'I-know-better-than-the-OP' gene that you and several others around here have. I don't miss it.
&lt;/i&gt;&lt;/blockquote&gt;&lt;p&gt;
Where did I say a specific language that I was assuming?  I guess you have the "You know better than some" gene, since you aren't taking me at my word.
&lt;/p&gt;&lt;p&gt;
That insult is so comical in the face of you presuming that this unspecified language accepts the following for string literals: &lt;c&gt;"(?:\\\\|\\[abfnrt]|\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2,4}|\\"|[^"])+?"&lt;/c&gt;.  That is an impressively specific set of features for an unspecified language.
&lt;/p&gt;&lt;p&gt;
I tried to be quite polite.  But I am not surprised that you found it so very hard to admit to even a simple mistake that you responded with an attack.  Just saddened.
&lt;/p&gt;&lt;p&gt;
The OP didn't say that they are using a language that parses string literals inside of block comments.  They certainly didn't say that their language parses string literals &lt;em&gt;only&lt;/em&gt; inside of block comments.
&lt;/p&gt;&lt;p&gt;
The idea of there even existing a language where string literals are parsed only inside of block comments is quite humorous.  But that is all that your regex tries to handle.
&lt;/p&gt;&lt;p&gt;
But composing the regex 'backward' in that way is quite a simple mistake.  The kind of mistake I make all the time.  Most people do.
&lt;/p&gt;&lt;p&gt;
I am sorry my correction caused you distress (or seemed to).  That wasn't my intent.  I would appreciate it if you would at least refrain from responding with another insult.  (I thought pointing out the mistake was actually more polite than down-voting and not commenting, something you've complained about repeatedly.)
&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-22609"&gt;&lt;p align="right"&gt;
- [tye]&lt;tt&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/tt&gt;
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
996552</field>
<field name="parent_node">
996585</field>
</data>
</node>
