Fix regexes and potential call on undefined result
Fix regexes and potential call on undefined result

pact-foundation/pact-node,pact-foundation/pact-node,pact-js/pact-node,pact-foundation/pact-node,pact-foundation/pact-node