# Regex to avoid escaped quotes or double quotes

**URL:** <https://www.ruby-forum.com/t/regex-to-avoid-escaped-quotes-or-double-quotes/127497>\
**Category:** Ruby\
**Created:** [January 29, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/regex-to-avoid-escaped-quotes-or-double-quotes/127497 "2008-01-29T20:41:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [January 29, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/regex-to-avoid-escaped-quotes-or-double-quotes/127497/1 "2008-01-29T20:41:11Z")

</div>

I am doing an xpath compiler.

Biggest problem is how to ignore single and double quoted literals …  
along  
with escaped quotes.

Like the following (avoiding the quoted literal):

/some/cool/xml/path[fn:count(subelement[@title  
=‘fn:count("/some/cool/xml/path[fn:count(subelement[@title  
=‘fn:count()’])]")’])]

I’ll post more as I work to solve it … not even posting what i have  
now as  
it is too weak.

-jhn
