Change regexp pattern to ungreedy

Regexp is greedy by default, which means, that the first occurrence of "+" after "/([^_]+..." tries to capture longest possible match, i.e. in string "idCategoryDefault" it match everything, that is not "_", longest possible occurrence, that ends with upper character. So the first matching group takes $1 = "idCategory", second $2 = "Default" and the final result is "idcategory_default". Ungreedy regexp returns "id_category_default", which is expected result.