1921 shaares
10 private links
10 private links
35 results
tagged
RegEx
I want to decode a Base64 encoded string, then store it in my database. If the input is not Base64 encoded, I need to throw an error.
How can I check if a string is Base64 encoded?
String encoded = parse.matcher(pem).replaceFirst("$1");
replaceAll("\p{C}", "?");
(0[1-9]|1[1,2])(\/|-)(0[1-9]|[12][0-9]|3[01])(\/|-)(19|20)\d{2}
^@(?=(.{4})$)[A-Za-z0-9+/]={0,2}$
if (paddingRequired) {
regex = /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/;
}
else {
regex = /^(?:[A-Za-z0-9+\/]){2,}(={0,2})$/;
}