Update regex to match within ternary if block

Fixes #31