[2.0]: dont use character classes in patterns
@jkowalleck is already working on this.
Since Jul 29, 2026.
Assessment
This issue has not been assessed yet.
Description
per https://json-schema.org/understanding-json-schema/reference/regular_expressions
Use only standard escapes like
\n,\r,\tand keep in mind that you also need to do JSON escaping.
we already do this here
- https://github.com/CycloneDX/specification/blob/2a860677bc58cc9accd7c8810eee1b4f29ce3343/schema/2.0/model/cyclonedx-common-2.0.schema.json#L23
- https://github.com/CycloneDX/specification/blob/2a860677bc58cc9accd7c8810eee1b4f29ce3343/schema/2.0/model/cyclonedx-common-2.0.schema.json#L31
- https://github.com/CycloneDX/specification/blob/2a860677bc58cc9accd7c8810eee1b4f29ce3343/schema/2.0/model/cyclonedx-common-2.0.schema.json#L94
- https://github.com/CycloneDX/specification/blob/2a860677bc58cc9accd7c8810eee1b4f29ce3343/schema/2.0/model/cyclonedx-common-2.0.schema.json#L770
so character classes are not universal - some regex engines just dont support them.
we should take care of this , and use the custom character classes in these cases.
like [0-9] for \d
things to fix:
- https://github.com/CycloneDX/specification/pull/678#discussion_r3677227543
- https://github.com/CycloneDX/specification/blob/2a860677bc58cc9accd7c8810eee1b4f29ce3343/schema/2.0/model/cyclonedx-common-2.0.schema.json#L495
- to be contiinued
tooling
have a QA tool that asserts that only those common/standard regex patterns are used
- Dominant language
- XSLT
- Stars
- 551
- Forks
- 93
- Avg merge
- 4h 51m
- Merged PRs (30d)
- 42
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CycloneDX/specification
-
Response vs Responce Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100
CycloneDX/specification#1121 ·
-
defect documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CycloneDX/specification#1115 ·
-
cap: cryptography-registry
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CycloneDX/specification#1098 ·
-
defect
Difficulty 1/5 Under an hour Newbie friendliness 91/100
CycloneDX/specification#1045 · 2 comments ·
-
CDX 2.0 documentation ready for review
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
CycloneDX/specification#1035 ·