Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   regex to avoid escaped quotes or double quotes (http://www.velocityreviews.com/forums/t847745-regex-to-avoid-escaped-quotes-or-double-quotes.html)

jOhn 01-29-2008 07:40 PM

regex to avoid escaped quotes or double quotes
 
[Note: parts of this message were removed to make it a legal post.]

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


Phlip 01-29-2008 08:31 PM

Re: regex to avoid escaped quotes or double quotes
 
jOhn wrote:

> I am doing an xpath compiler.


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


Have you raided Hpricot for "inspiration"?

(Its XPath is weak but its parsing in general is excellent!)

--
Phlip


All times are GMT. The time now is 01:08 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.