Implement the !-box matching subroutine

Currently untested.