Better B64 regex, shoutout to ~ASM

This commit is contained in:
panki27 2017-10-24 11:16:01 +02:00
parent 8bfd7b2468
commit 4fda56d33b

View File

@ -61,7 +61,7 @@ def translate(inputString, inputType, outputType):
result = chr(inputString)
return result
def base64prompt():
b64regex = '\S*=$'
b64regex = '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$'
inputString = raw_input('Please input your string: ')
match = re.match(b64regex, inputString)
if (match):