Updating the regex parsing to deal with more cases