Add extra pattern to regular expresion

Regular expresion matches only extensions at the end of the line; a new
test was added to check for this.