-3
Write a regular expression substitution string which can base64 decode a string using only a regular expression engine built into the language. Eg:
# Example in python
import re
print(re.sub(..., ..., "SGVsbG8gd29ybGQK")) # "Hello world\n"
# ^^^ ^^^
# These count towards your byte count, the rest doesn't
Rules:
- No libraries
- No tools like
base64
in bash - Must be a regular expression
- Must decode RFC 4648 based base64
- Any programming language (eg: Python, JavaScript, PHP, Ruby, Awk, Sed)
- Length of your find string + Length of your replace string = Byte count
- Shortest byte count wins
3I'm pretty sure this isn't even possible with a single regular-expression-based replacement. – Felix Palmen – 2018-12-11T11:14:06.643
@JoKing my bad, didn't even realise, updated it to say RFC 4648 standard – Paradoxis – 2018-12-11T11:42:37.870
1Although it's possible to do this using multiple regex replacement. – user202729 – 2018-12-11T13:47:59.540
Would it be possible to change this to regex golf somehow? – lirtosiast – 2018-12-11T14:12:48.197
3Hello, I closed this as unclear because you have defined the exact form of base64 to be used, but you haven't clearly defined what constitutes single regex replacement and what would be illegal (the most logical definition based on your scoring would make this an impossible challenge). – HyperNeutrino – 2018-12-11T14:27:15.077