Skip to content

Make DateTime and SemVer patterns more portable#1213

Open
bact wants to merge 2 commits intospdx:developfrom
bact:defensive-datetime-pattern
Open

Make DateTime and SemVer patterns more portable#1213
bact wants to merge 2 commits intospdx:developfrom
bact:defensive-datetime-pattern

Conversation

@bact
Copy link
Collaborator

@bact bact commented Jan 23, 2026

Make the patterns more defensive/portable, keep the original semantics.

A SHACL processor may rely on platform's regular expression engine and some engine interpret \d as any Unicode decimal digit, beyond ASCII 0 - 9 characters, by default.

In those engines, \d can match, for example: १ २ ३ ๔ ๕ ๖ ၉

Tested with .NET System.Text.RegularExpressions and PyICU (ICU4C).

bact added 2 commits January 23, 2026 10:28
Make the pattern more defensive/portable.

SHACL processor may rely on platform's regex engine and some engine interpret `\d` as any Unicode decimal digit beyond ASCII `0` - `9` characters.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added the Profile:Core Core profile and related matters label Jan 23, 2026
@kestewart kestewart requested a review from zvr January 24, 2026 16:11
@kestewart kestewart added this to the 3.1-rc2 milestone Jan 24, 2026
@bact
Copy link
Collaborator Author

bact commented Mar 3, 2026

@JPEWdev will this relevant to regex in shacl2code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Profile:Core Core profile and related matters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants