kevva / base64-regex

Regular expression for matching base64 encoded strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The regex can't match some base64 string

minwe opened this issue · comments

438026444 convert to base64 string is NDM4MDI2NDQ0, the regex can't match this.

This function works well.

Me also facing some issue testing some base64 strings such as "NTkxNjVSRUZVSV9JU19QaGFybWFjeV9TdGFmZixBc3Npc3RhbnRNYW5hZ2Vy"

When I validate those base64-strings it validates them as correct.

This regex seems working well:
(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})

Wow... after three years I am checking this issue again... and still the catastrophic backtracking version is not updated.