zazuko / vscode-sparql-notebook

Visual Studio Code SPARQL Notebook Extension
https://marketplace.visualstudio.com/items?itemName=Zazuko.sparql-notebook
Other
26 stars 8 forks source link

Does not accept file with REGEX pattern #81

Closed kvistgaard closed 5 months ago

kvistgaard commented 6 months ago

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 commented 6 months ago

@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 commented 5 months ago

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