limit
limit

Reputation: 647

Regex Match Numeric in URL

I am trying to setup a tracking script which hits on a url. However I am lost on how to ignore the number in the url.

For example - the url is /account/checkout/21212/complete

Where 21212 is always random or changing, how can I match the URL with regex even with the changing 21212 number?

Something like /account/checkout/regex number/complete

Any suggestion would be appreciated.

Upvotes: 0

Views: 64

Answers (1)

M A
M A

Reputation: 72844

Use \d to match a digit, with + to match one or more occurrences:

/account/checkout/\d+/complete

Upvotes: 2

Related Questions