Skip to main content
typo fix, explanation wasn't clear, clarify why it's specific to GNU `sed`
Source Link

GNU sed 17 16 bytes

Thanks to @someone in the comments for pointing out I had this solution backwards, that allowed me to shave off the no-matches check

/\bill[aiouy]/q1

Explained:

/                # Start pattern
 \b              # Match word boundaries
   ill           # Match literal "ill" as start of a word
      [aiouy]    # Match any of [aiouy] directly after
             /   # End pattern
              q1 # If found, exit with status 1,. Evaluates to false as per POSIX

q (or Q to silence output) is a GNU extension to the program to set the exit status if a condition is matched. See the GNU sed script overview for examples, and the command list for the command's description.

GNU sed 17 16 bytes

Thanks to @someone in the comments for pointing out I had this solution backwards, that allowed me to shave off the no-matches check

/\bill[aiouy]/q1

Explained:

/                # Start pattern
 \b              # Match word boundaries
   ill           # Match literal "ill" as start of a word
      [aiouy]    # Match any of [aiouy] directly after
             /   # End pattern
              q1 # If found, exit with status 1, to false as per POSIX

GNU sed 17 16 bytes

Thanks to @someone in the comments for pointing out I had this solution backwards, that allowed me to shave off the no-matches check

/\bill[aiouy]/q1

Explained:

/                # Start pattern
 \b              # Match word boundaries
   ill           # Match literal "ill" as start of a word
      [aiouy]    # Match any of [aiouy] directly after
             /   # End pattern
              q1 # If found, exit with status 1. Evaluates to false as per POSIX

q (or Q to silence output) is a GNU extension to the program to set the exit status if a condition is matched. See the GNU sed script overview for examples, and the command list for the command's description.

golfed a byte thanks to a sharp commenter
Source Link

GNU sed 1717 16 bytes

Thanks to @someone in the comments for pointing out I had this solution backwards, that allowed me to shave off the no-matches check

/\bill[aiouy]/!q1

Explained:

/                    # Start pattern
 \b                  # Match word boundaries
   ill               # Match literal "ill" as start of a word
      [aiouy]        # Match any of [aiouy] directly after
             /       # End pattern
              !     q1 # If no match is found
               q1    # Exit, andexit setwith status to 1, OK exits areto 0false as per POSIX

GNU sed 17 bytes

/\bill[aiouy]/!q1

Explained:

/                    # Start pattern
 \b                  # Match word boundaries
   ill               # Match literal "ill" as start of a word
      [aiouy]        # Match any of [aiouy] directly after
             /       # End pattern
              !      # If no match is found
               q1    # Exit and set status to 1, OK exits are 0 as per POSIX

GNU sed 17 16 bytes

Thanks to @someone in the comments for pointing out I had this solution backwards, that allowed me to shave off the no-matches check

/\bill[aiouy]/q1

Explained:

/                # Start pattern
 \b              # Match word boundaries
   ill           # Match literal "ill" as start of a word
      [aiouy]    # Match any of [aiouy] directly after
             /   # End pattern
              q1 # If found, exit with status 1, to false as per POSIX
Source Link

GNU sed 17 bytes

/\bill[aiouy]/!q1

Explained:

/                    # Start pattern
 \b                  # Match word boundaries
   ill               # Match literal "ill" as start of a word
      [aiouy]        # Match any of [aiouy] directly after
             /       # End pattern
              !      # If no match is found
               q1    # Exit and set status to 1, OK exits are 0 as per POSIX