On Wed, 22 Mar 2017 12:55:27 -0700, Oleksii Segeda
<[email protected]> wrote:
> Hi everyone,
>
> Quick questions regarding regex in ML:
>
>
> 1. What's ML alternative to word boundaries \b? Seems that
> fn:analyze-string doesn't support this special character.
>
> 2. Does JS version of this function (fn.analyzeString) use JS
> regex engine? If so, why it gives me error for fn.analyzeString("foo bar
> bar", "\\b(bar)\\b") ?
The regex language doesn't have non-capturing groups, but with some
post-processing you could do this:
"(^|\W)(bar)(\W|$)"
or if you don't, then unroll it:
"^(bar)$|^(bar)\W|\W(bar)$|\W(bar)\W"
//Mary
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general