#GNU grep, 62 + 1 = 63 bytes
GNU grep, 62 + 1 = 63 bytes
^(((.+)(?=.*!3円))*(...)(?=.*4円!)((.+)(?=.*6円!))*([^qvz]\B)?)+
This requires the P option. The input is expected to be the animal to be synthesized, followed by a space, followed by the list of 3-letter animals opened, closed, and delimited by exclamation marks. Example usage (assuming the program is saved as zoo):
> grep -Pf zoo
hippopotamus !ant!ape!asp!ass!bat!bee!boa!cat!cod!cow!dab!dog!eel!elk!emu!fly!fox!gnu!hog!ide!jay!kea!kob!koi!olm!owl!pig!rat!ray!yak!
For a true input, the input line is echoed back. For a false input, there is no output.
Thanks to Martin for spotting a bug and alerting me to the existence of \B for word non-boundary.
#GNU grep, 62 + 1 = 63 bytes
^(((.+)(?=.*!3円))*(...)(?=.*4円!)((.+)(?=.*6円!))*([^qvz]\B)?)+
This requires the P option. The input is expected to be the animal to be synthesized, followed by a space, followed by the list of 3-letter animals opened, closed, and delimited by exclamation marks. Example usage (assuming the program is saved as zoo):
> grep -Pf zoo
hippopotamus !ant!ape!asp!ass!bat!bee!boa!cat!cod!cow!dab!dog!eel!elk!emu!fly!fox!gnu!hog!ide!jay!kea!kob!koi!olm!owl!pig!rat!ray!yak!
For a true input, the input line is echoed back. For a false input, there is no output.
Thanks to Martin for spotting a bug and alerting me to the existence of \B for word non-boundary.
GNU grep, 62 + 1 = 63 bytes
^(((.+)(?=.*!3円))*(...)(?=.*4円!)((.+)(?=.*6円!))*([^qvz]\B)?)+
This requires the P option. The input is expected to be the animal to be synthesized, followed by a space, followed by the list of 3-letter animals opened, closed, and delimited by exclamation marks. Example usage (assuming the program is saved as zoo):
> grep -Pf zoo
hippopotamus !ant!ape!asp!ass!bat!bee!boa!cat!cod!cow!dab!dog!eel!elk!emu!fly!fox!gnu!hog!ide!jay!kea!kob!koi!olm!owl!pig!rat!ray!yak!
For a true input, the input line is echoed back. For a false input, there is no output.
Thanks to Martin for spotting a bug and alerting me to the existence of \B for word non-boundary.
#GNU grep, 6462 + 1 = 6563 bytes
^(((.+)(?=.*!3円))*(...)(?=.*4円!)((.+)(?=.*6円!))*([^qvz](?! )[^qvz]\B)?)+
This requires the P option. The input is expected to be the animal to be synthesized, followed by a space, followed by the list of 3-letter animals opened, closed, and delimited by exclamation marks. Example usage (assuming the program is saved as zoo):
> grep -Pf zoo
hippopotamus !ant!ape!asp!ass!bat!bee!boa!cat!cod!cow!dab!dog!eel!elk!emu!fly!fox!gnu!hog!ide!jay!kea!kob!koi!olm!owl!pig!rat!ray!yak!
For a true input, the input line is echoed back. For a false input, there is no output.
Thanks to Martin for spotting a bug and alerting me to the existence of \B for word non-boundary.
#GNU grep, 64 + 1 = 65 bytes
^(((.+)(?=.*!3円))*(...)(?=.*4円)((.+)(?=.*6円!))*([^qvz](?! ))?)+
This requires the P option. The input is expected to be the animal to be synthesized, followed by a space, followed by the list of 3-letter animals opened, closed, and delimited by exclamation marks. Example usage (assuming the program is saved as zoo):
> grep -Pf zoo
hippopotamus !ant!ape!asp!ass!bat!bee!boa!cat!cod!cow!dab!dog!eel!elk!emu!fly!fox!gnu!hog!ide!jay!kea!kob!koi!olm!owl!pig!rat!ray!yak!
For a true input, the input line is echoed back. For a false input, there is no output.
#GNU grep, 62 + 1 = 63 bytes
^(((.+)(?=.*!3円))*(...)(?=.*4円!)((.+)(?=.*6円!))*([^qvz]\B)?)+
This requires the P option. The input is expected to be the animal to be synthesized, followed by a space, followed by the list of 3-letter animals opened, closed, and delimited by exclamation marks. Example usage (assuming the program is saved as zoo):
> grep -Pf zoo
hippopotamus !ant!ape!asp!ass!bat!bee!boa!cat!cod!cow!dab!dog!eel!elk!emu!fly!fox!gnu!hog!ide!jay!kea!kob!koi!olm!owl!pig!rat!ray!yak!
For a true input, the input line is echoed back. For a false input, there is no output.
Thanks to Martin for spotting a bug and alerting me to the existence of \B for word non-boundary.
#GNU grep, 64 + 1 = 65 bytes
^(((.+)(?=.*!3円))*(...)(?=.*4円)((.+)(?=.*6円!))*([^qvz](?! ))?)+
This requires the P option. The input is expected to be the animal to be synthesized, followed by a space, followed by the list of 3-letter animals opened, closed, and delimited by exclamation marks. Example usage (assuming the program is saved as zoo):
> grep -Pf zoo
hippopotamus !ant!ape!asp!ass!bat!bee!boa!cat!cod!cow!dab!dog!eel!elk!emu!fly!fox!gnu!hog!ide!jay!kea!kob!koi!olm!owl!pig!rat!ray!yak!
For a true input, the input line is echoed back. For a false input, there is no output.