(?:this)?|(?:that)?|(?:third_thing)?) if( ! $1 ){} #or defined, but why bother #nvm, see below vs $_ = /(this|that|third_thing)?/; if( defined $1 eq "" ){}