fix regexp match if/else