Skip to content

Instantly share code, notes, and snippets.

@meandavejustice
Created January 20, 2023 01:59
Show Gist options
  • Save meandavejustice/c5226ce667a159368e51b8199d013ddc to your computer and use it in GitHub Desktop.
Save meandavejustice/c5226ce667a159368e51b8199d013ddc to your computer and use it in GitHub Desktop.
Regular expression for parsing CIDs from IPFS
const CID_REGEXP = /(Qm[1-9A-HJ-NP-Za-km-z]{44,}?|b[A-Za-z2-7]{58,}?|B[A-Z2-7]{58,}?|z[1-9A-HJ-NP-Za-km-z]{48,}?|F[0-9A-F]{50,}?)/
@meandavejustice
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment