Supabase UUID Regex Pattern #2788
zfett
started this conversation in
Show and tell
Replies: 1 comment
-
You don't need the group parenthesis and the character set syntax handles OR conditionals, so this could be: Also, the UUID standard does not specify the casing, so really it's valid uppercase or lowercase, which can be handled with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all, I've made a regex pattern that can be used to validate Supabase UUIDs if needed. It even accounts for having multiple UUIDs on separate newlines! I've uploaded it over on RegExr, complete with tests! Check it out here.
My regex is a bit rusty, so if you happen to notice that I forgot something or made a boo-boo, feel free to let me know and send any feedback my way!
Regex Pattern:
/^([a-f]|[0-9]){8}-([a-f]|[0-9]){4}-([a-f]|[0-9]){4}-([a-f]|[0-9]){4}-([a-f]|[0-9]){12}$/gm
Beta Was this translation helpful? Give feedback.
All reactions