Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not accept file with REGEX pattern #81

Closed
kvistgaard opened this issue Apr 25, 2024 · 2 comments
Closed

Does not accept file with REGEX pattern #81

kvistgaard opened this issue Apr 25, 2024 · 2 comments

Comments

@kvistgaard
Copy link

When trying to set a SHACL shapes file to query, it gives an error

image

It is part of a regex pattern

    sh:or (
        [ sh:datatype xsd:date ]
        [ sh:datatype xsd:string ; sh:pattern "^\d{2}/\d{2}/\d{4}$|^\d{4}/\d{2}/\d{2}$" ]
    ) ;
@BenjaminHofstetter
Copy link
Collaborator

BenjaminHofstetter commented Apr 30, 2024

@kvistgaard
my editor is complains about your string too.

sh:pattern "^\d{2}/\d{2}/\d{4}$|^\d{4}/\d{2}/\d{2}$" 

you have to escape with \\
e.g.

sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ;

is it the problem ?

@kvistgaard
Copy link
Author

Yes, indeed, the backlash itself needs escaping in the expression"". Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants