As portforwardpodcast pointed out, a 256 bit number will be decoded into 43 characters with one =
at the end as filler.
Only the first four bits are used of the number that the 43th character represents, so it can only be a character that represents a number where the two last bits are zero.
You can make a simpler regular expression to validate this than any base64 string, as you know exactly how long it should be:
^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$