Improve Regex expression to match depedency expression