Revision 0760db56-455a-4952-aab5-bc4e47ba7b93 - Code Golf Stack Exchange
# [Retina 0.8.2], 53 bytes
^
;
+%`;(.)
1ドル;$'¶$`;
.+
$*
%A`^.?$|^(..+)1円+$
^1+¶+$
[Try it online!][TIO-kfbkobs1] Link includes test cases. Explanation:
^
;
+%`;(.)
1ドル;$'¶$`;
Generate all subsequences of the input.
.+
$*
Convert then to unary.
%A`^.?$|^(..+)1円+$
Delete the ones that aren't prime, but don't delete the newlines. (A multiline replace also works, but is harder to format an explanation for.)
^1+¶+$
Check that the original input was prime but none of the proper subsequences were.
[Retina 0.8.2]: https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d
[TIO-kfbkobs1]: https://tio.run/##DcO7DYAgEADQ/uY4InjJRRQ/hMJYuYQhWFjYWBhL53IAFsN7ybuP57z2ovSaSoQApFLQbABtwCp/mAIwAdaglhR5xjdqZjKbJYRoKX@EpbjGg7OylZ10speDHOUkvf8B "Retina 0.8.2 – Try It Online"