Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: RegEx 解析或验证 Base64 数据
如何使用正则表达式在 Javascript 中验证 Base64 字符串?
See if this answer fits you, from another user:
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$