Skip to content

Conversation

@esmasth
Copy link
Contributor

@esmasth esmasth commented Sep 7, 2024

This addresses #239

https://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/impl/xpath/regex/RegularExpression.html used by yang-lsp expects W3C pattern which is single quoted, whereas YANG double quoted syntax includes escaped backslashes \\ which need to be unescaped before passing to W3C pattern regex handler.

@esmasth esmasth changed the title Handled double quoted patterns Handle double quoted patterns Sep 7, 2024
Escaped backslashes `\\` within double quoted pattern arguments
need to be unescaped before using xerces RegularExpression()

This addresses TypeFox#239

Signed-off-by: Siddharth Sharma <[email protected]>
@Check
def checkPattern(Pattern it) {
// https://tools.ietf.org/html/rfc7950#section-9.4.5
// If 'it' is double quoted replace all '\\' with '\'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dhuebner could you please help how to achieve unescaping backslashes in case the pattern is double quoted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bump

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

Successfully merging this pull request may close these issues.

1 participant