sed, (削除) 26 (削除ここまで) 24 bytes
-2 from @GammaFunction for swapping truthy/falsy
/[1ACFHLRSacdfgik-tx]/Q1
guess I can start it off with the obvious solution. I alphabetizedalphabetized the options so that I could abbreviate any ranges; but k-t was the only one. in sed, Q means 'immediately quit', and it takes an optional number as an error code; so if input was a good char then it'll quit with an error code of 1, otherwise it'll exit normally with your input in stdout.
if you need it to check if the entire string is a valid option, it'd look like
/^[1ACFHLRSacdfgik-tx]*$/Q1
sed, (削除) 26 (削除ここまで) 24 bytes
-2 from @GammaFunction for swapping truthy/falsy
/[1ACFHLRSacdfgik-tx]/Q1
guess I can start it off with the obvious solution. I alphabetized the options so that I could abbreviate any ranges; but k-t was the only one. in sed, Q means 'immediately quit', and it takes an optional number as an error code; so if input was a good char then it'll quit with an error code of 1, otherwise it'll exit normally with your input in stdout.
if you need it to check if the entire string is a valid option, it'd look like
/^[1ACFHLRSacdfgik-tx]*$/Q1
sed, (削除) 26 (削除ここまで) 24 bytes
-2 from @GammaFunction for swapping truthy/falsy
/[1ACFHLRSacdfgik-tx]/Q1
guess I can start it off with the obvious solution. I alphabetized the options so that I could abbreviate any ranges; but k-t was the only one. in sed, Q means 'immediately quit', and it takes an optional number as an error code; so if input was a good char then it'll quit with an error code of 1, otherwise it'll exit normally with your input in stdout.
if you need it to check if the entire string is a valid option, it'd look like
/^[1ACFHLRSacdfgik-tx]*$/Q1
sed, 26(削除) 26 (削除ここまで) 24 bytes
-2 from @GammaFunction for swapping truthy/falsy
/[1ACFHLRSacdfgik-tx]/Q
Q1
guess I can start it off with the obvious solution. I alphabetized the options so that I could abbreviate any ranges; but k-t was the only one. in sed, Q means 'immediately quit', and it takes an optional number as an error code; so if input was a good char then it'll quit normally, and if it wasn't it'll givewith an error code of 1, otherwise it'll exit normally with your input in stdout.
if you need it to check if the entire string is a valid option, it'd look like
/^[1ACFHLRSacdfgik-tx]*$/Q
Q1
sed, 26 bytes
/[1ACFHLRSacdfgik-tx]/Q
Q1
guess I can start it off with the obvious solution. I alphabetized the options so that I could abbreviate any ranges; but k-t was the only one. in sed, Q means 'immediately quit', and it takes an optional number as an error code; so if input was a good char then it'll quit normally, and if it wasn't it'll give an error code of 1.
if you need it to check if the entire string is a valid option, it'd look like
/^[1ACFHLRSacdfgik-tx]*$/Q
Q1
sed, (削除) 26 (削除ここまで) 24 bytes
-2 from @GammaFunction for swapping truthy/falsy
/[1ACFHLRSacdfgik-tx]/Q1
guess I can start it off with the obvious solution. I alphabetized the options so that I could abbreviate any ranges; but k-t was the only one. in sed, Q means 'immediately quit', and it takes an optional number as an error code; so if input was a good char then it'll quit with an error code of 1, otherwise it'll exit normally with your input in stdout.
if you need it to check if the entire string is a valid option, it'd look like
/^[1ACFHLRSacdfgik-tx]*$/Q1
sed, 26 bytes
/[1ACFHLRSacdfgik-tx]/Q
Q1
guess I can start it off with the obvious solution. I alphabetized the options so that I could abbreviate any ranges; but k-t was the only one. in sed, Q means 'immediately quit', and it takes an optional number as an error code; so if input was a good char then it'll quit normally, and if it wasn't it'll give an error code of 1.
if you need it to check if the entire string is a valid option, it'd look like
/^[1ACFHLRSacdfgik-tx]*$/Q
Q1