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

Does not work for GUUID validation #27

Open
tawmoto opened this issue Jan 3, 2019 · 3 comments
Open

Does not work for GUUID validation #27

tawmoto opened this issue Jan 3, 2019 · 3 comments

Comments

@tawmoto
Copy link

tawmoto commented Jan 3, 2019

Hello, it seems that it does not work for GUUID validation

const char* pattern = "^([0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12})$";
int m = re_match(pattern, "CA761232-ED42-11CE-BACD-00AA0057B223");

This works with online tools https://regex101.com/r/hD8sJ8/3

Thank you

@ToriningenGames
Copy link
Contributor

Disclaimer: I am not the maintainer.

Your regex contains quantifiers ({8} etc.). Currently, they are not supported (ref. Issues #18, #29).
For this reason, I'd expect your regex to fail. Issue #29 points to a fork that, while out of date, does support quantifiers. Or, while more tedious and harder to maintain, repeating the character group prior to the quantifier would work.

@monolifed
Copy link
Contributor

It supports match length now. You can do it with a few matches

There is another fork that supports quantifiers: https://github.com/monolifed/tiny-regex-mod

@rurban
Copy link

rurban commented Jun 20, 2022

My times branch also supports this.

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

No branches or pull requests

4 participants