jaytea commented on a Page, RegEx Swear Kick  -  Apr 04, 2011

Gummo, '\' is a literal in between \Q and \E. '\Q\E\E' matches '\' with the second '\E' being superfluous. the rule is simpler than you make it out to be: '\Q' quotes a string up until the very next occurrence of '\E'. everything single thing in between '\Q' and '\E' is treated literally - that is why the simplest way to escape '\E' in the middle of a quote is to use '\E\E\Q', and that is why replacing every occurrence in that way results in a correctly quoted string 100% of the time.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.