Rachel Butler
10/06/2022, 6:30 PMYousaf Nabi (pactflow.io)
/transactions
https://rubular.com/
\/accounts\/[A-Za-z0-9]+(?:\/transactions)?
Yousaf Nabi (pactflow.io)
For example, we have two endpoints "/accounts/{accountId}" and "/accounts/{accountId}/transactions" that we would expect two different responses.Oh do you want a capture group that only captures
/accounts/123/transactions
but excludes /accounts/123
?Yousaf Nabi (pactflow.io)
\/accounts\/[A-Za-z0-9]+\/transactions
Yousaf Nabi (pactflow.io)
/accounts/123
and excluding anything with an additional forward slash after your alpha/digit capture group
\/accounts\/[A-Za-z0-9]+(?!\/|[A-Za-z0-9])
Rachel Butler
10/06/2022, 7:39 PMRachel Butler
10/07/2022, 5:07 PMRachel Butler
10/07/2022, 5:45 PMError - value to generate "/accounts/el$" does not match regular expression /\/accounts\/[A-Za-z0-9]+$/
But, if I pass in an example myself that actually fits the regex (ex. /accounts/123) this approach works great.