Skip to content

Instantly share code, notes, and snippets.

@johnatanbrayan
Created April 11, 2021 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnatanbrayan/3bfef8a5e3405206d616f321b37ffcdd to your computer and use it in GitHub Desktop.
Save johnatanbrayan/3bfef8a5e3405206d616f321b37ffcdd to your computer and use it in GitHub Desktop.
Regex Base64 Java
**** Regex Base64:
(?:[A-Za-z0-9+\/]{4}\\n?)*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=) // Best
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$
^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment