Hi,

Thank you, Dave and Geert!

That's exactly that "maybe escape some more chars" that I wanted to
avoid.  By the way, "?" should be changed to "." in a regex.

Thank you for confirming, regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 4 February 2016 at 16:26, Geert Josten wrote:
> Yeah, basically replace . with \., and * with .*, and ? with .?
>
> And maybe escape some more chars like ( and [..
>
> From: <[email protected]> on behalf of Dave Cassel
> <[email protected]>
> Reply-To: MarkLogic Developer Discussion <[email protected]>
> Date: Thursday, February 4, 2016 at 4:15 PM
> To: MarkLogic Developer Discussion <[email protected]>
> Subject: Re: [MarkLogic Dev General] URI pattern match function
>
> I don't think so, but changing a URI pattern to a proper regex is pretty
> straightforward:
>
> let $str := '/foo/stuff/bar-none.xml'
> return fn:matches($str, '/foo/.*/bar-.*\.xml')
> => true
>
> --
> Dave Cassel, @dmcassel
> Technical Community Manager
> MarkLogic Corporation
> http://developer.marklogic.com/
>
>
> From: <[email protected]> on behalf of Florent Georges
> <[email protected]>
> Reply-To: MarkLogic Developer Discussion <[email protected]>
> Date: Thursday, February 4, 2016 at 9:37 AM
> To: MarkLogic Developer Discussion <[email protected]>
> Subject: [MarkLogic Dev General] URI pattern match function
>
> Hi,
>
> The function cts:uri-matches takes a URI pattern as a parameter.
> Something that looks a bit like a file glob in Shell:
> /foo/*/bar-*.xml.
>
> Is there a function that returns whether a given string matches such a
> pattern?  A bit like fn:matches, but for a URI pattern instead of a
> proper regex.
>
> Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to