$FileExt =~/ # "file extension matches ...." \A # the start of the variable \. # match a literal dot (?: # begin a set of options foo # the option itself | # OR bar # another option ) # end of option group \z # end of variable /x; # end of pattern, enable comments in the regex