Can't solve Bob Exercise in SQLite

Hello. I’m stuck in the Bob exercie (SQLite). I’ve tried many different regex, but when I solve for some cases, others that were solved previously go back into the list of failed tests. I’ve been trying for days unsuccessfully. t’s driving me crazy! What am I missing?

This is the best I’ve been able to achieve, passing 18/25 tests.

UPDATE "bob"
SET "reply" =
    CASE
        WHEN ("input" LIKE "%?" AND "input" NOT GLOB "*[A-Z\s]") THEN "Sure."
        WHEN ("input" GLOB "*[A-Z\s]" AND "input" NOT LIKE "%?") THEN "Whoa, chill out!"
        WHEN ("input" GLOB "*[A-Z\s]" AND "input" LIKE "%?") THEN "Calm down, I know what I'm doing!"
        WHEN ("input" = "" OR "input" LIKE " % ") THEN "Fine. Be that way!"
        ELSE "Whatever."
    END

The tests I’m failing with this code:

shouting
forceful question
shouting numbers
shouting with special characters
alternate silnce
ending with white space
other white space

Please, can anybody help me??

Two hints:

Using other functions like UPPER(), LOWER() and TRIM() lead to quite near solutions.

One neat solution that just uses regexps, checks in the following order:

  • ‘Fine. Be that way!’
  • ‘Calm down, I know what I’‘m doing!’
  • ‘Whoa, chill out!’
  • ‘Sure.’
  • ‘Whatever.’

I presume you want hints like these? If you’re looking for answers, you can always unlock the Community Solutions tab at Community solutions for Bob in SQLite on Exercism but that may feel too much like cheating for you :slight_smile: