I believe '\b' is equivalent to "start of line OR end of line OR non-word". This seems to work with 4.1-1:

xquery version "1.0-ml";
let $pat := '(^|\W)xxx(\W|$)'
for $test in ('xxx', 'a xxx b', 'xxxz xxx', 'xxx xxxz')
return replace($test, $pat, '$1yyy$2')

=>
yyy
a yyy b
xxxz yyy
yyy xxxz

-- Mike

On 2009-09-01 06:59, judie pearline wrote:
Hi,
In Marklogic when i tried to use regular expression \b (word boundary) in replace 
function, its throwing an exception saying that "Invalid regular expression".

Code - fn:replace('organize the annual get-together','\bthe\b'," ")

The main purpose is to replace the word "the" with an empty string. But the string 
"the" in the word together should not get replaced.

Please help me on this.
Thanks,
Judie


________________________________
________________________________
Love Cricket? Check out live scores, photos, video highlights and more. Click 
here<http://in.rd.yahoo.com/tagline_cricket_2/*http://cricket.yahoo.com>.

_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to