Skip to content

Conversation

@alexandernorth
Copy link
Contributor

@alexandernorth alexandernorth commented Jun 24, 2025

The set of metacharacters is not the same between XML schema and perl/python/go Regular Expressions.

The set of metacharacters for XML schema is: .\?*+{}()[] (reference)
the set of metacharacters defined in go is: \.+*?()|[]{}^$ (go/libexec/src/regexp/regexp.go:714)

To maintain compatibility, we need to force escape the difference in these two sets (^ and $).
^ is a bit special as it is a valid metacharacter as the first char after the opening of a character set ([^...) so we make sure not to escape it in this position

Copy link
Collaborator

@steiler steiler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@hansthienpondt hansthienpondt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hansthienpondt hansthienpondt merged commit 2385800 into sdcio:main Jun 26, 2025
9 of 10 checks passed
@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 64.86486% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/utils/leaf_convert.go 64.86% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexandernorth alexandernorth deleted the fix/patterns-including-metacharacters branch June 26, 2025 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants