Title |
Test
Find
Valid Base64 string
|
Expression |
(([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?){1} |
Description |
The expression evaluates a Base64 string as a sequence of 4-byte blocks with a possible tail of 2 or 3-byte block with valid padding.
|
Matches |
AAAAAA== |
Non-Matches |
AAAAAA |
Author |
Rating:
Not yet rated.
Vassilis Petroulias
|
Source |
|
Your Rating |
|
Title: Mr.
Name: James Nixon
Date: 8/23/2011 2:19:59 PM
Comment:
It finds Base64 strings, but it also finds other sub-characters using the Java Matcher class. I had to use the non-intuitive Pattern.split(...) to get a String array and use the array status to use the regex string (0 size => Base64, otherwise not Base64).