Hi,

I'm trying to use regex in detecting html anchor tags.

So far, my Googling has yield this as the best regex to use
: <a[\s]+[^>]*?href[\s]?=[\s\"\']*(.*?)[\"\']*.*?>([^<]+|.*?)?<\/a>

My problem is, how do I assign that to a variable in XQuery so I can call
fn:analyze-string() . I was hoping to do it this way :

let $htmlBody := $asset/assetContent/htmlBody/string()
let $pattern :=
<a[\s]+[^>]*?href[\s]?=[\s\"\']*(.*?)[\"\']*.*?>([^<]+|.*?)?<\/a>
return fn:analyze-string($htmlBody, $pattern)

But I can't enclose the regex with either a single or double quote.

Any idea ?

Regards,
Danny
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to