Skip to content

Instantly share code, notes, and snippets.

@ThiagodePaulaSouza
Created March 11, 2023 21:41
Show Gist options
  • Save ThiagodePaulaSouza/28e3bdca9d366cecb97254709e0237ec to your computer and use it in GitHub Desktop.
Save ThiagodePaulaSouza/28e3bdca9d366cecb97254709e0237ec to your computer and use it in GitHub Desktop.
regex que identifica GUIDs
const rxGuid = new RegExp('[({]?[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}[})]?','g')
rxGuid.test('f2373f76-79e6-4c80-b148-18c498b62b62') //true
rxGuid.test('ihafsh-sfa-012a3129832-9has-jkhdasjk') //false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment