Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex issues #245

Closed
catalintgv opened this issue Nov 22, 2023 · 1 comment · Fixed by #337
Closed

Regex issues #245

catalintgv opened this issue Nov 22, 2023 · 1 comment · Fixed by #337
Labels

Comments

@catalintgv
Copy link

I`m using this regex: \d+(?:Mi|Gi|M|G)\b\Z and also as alternative \d+(?:Mi|Gi|M|G)\b(?!\s) but unittest does not recognize \Z and ?!
https://cheatography.com/davechild/cheat-sheets/regular-expressions/

FAIL Check the design service template myprog/tests/design_test.yaml
- Deployment check Memory and CPU of containers Image

            - asserts[0] `matchRegex` fail
                    Template:       myprog/templates/design.yaml
                    Error:
                            error parsing regexp: invalid escape sequence: `\Z`

FAIL Check the audit service template myprog/tests/audit_test.yaml
- Deployment check Memory and CPU of containers Image

            - asserts[0] `matchRegex` fail
                    Template:       myprog/templates/audit.yaml
                    Error:
                            error parsing regexp: invalid or unsupported Perl syntax: `(?!`
@quintush
Copy link
Contributor

quintush commented Dec 5, 2023

Hello @catalintgv,

It is correct the unittest does not support \Z and ?! regex.
See the following site for the supported regex syntax https://pkg.go.dev/regexp/syntax.

I also will add the reference to the documention.

Greetings,
@quintush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants