Why is optional group (([^:]+):)?
greedy?
/otpauth://totp/(([^:]+):)?([^?]+)?secret=([ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]+)&issuer=([^&]+)&algorithm=(SHA1)&digits=(6)&period=(30)/g
Trying to make Proton:
optional so that following text yields two matches.
otpauth://totp/[email protected]?secret=
BKQI7EKPHYG357HK6A3PY2VE&issuer=Proton&algorithm=SHA1&digits=6&period=30otpauth://totp/Proton:[email protected]?secret=
BKQI7EKPHYG357HK6A3PY2VE&issuer=Proton&algorithm=SHA1&digits=6&period=30