Revisions for "Get ID from url path - regex"

Get ID from url path - regex

Need some help getting IDs out of urls. Seems they can be 4-7 digits and i have the following rules . if possible can you use this https://regex101.com/ so we can easily test it.

here are the rules
- 4-7 digits

- cant be immediately followed by - or text

- cant be after ?

- cant be after #

here are some test urls

https://acme.com/cammins-1022

https://acme.com/francr-cameron-cummins-1022#home

https://acme.com/franchiummins-1025642?somthing

https://acme.com/cammins-1022

https://acme.com/francr-cameron-cummins-1022#home-321321-sadfg

https://acme.com/franchiummins-1025642?somthing-321321

https://acme.com/franchiummins-1025642-?somthing-321321

Get ID from url path - regex
Need some help getting IDs out of urls. Seems they can be 4-7 digits and i have the following rules . if possible can you use this https://regex101.com/ so we can easily test it. here are the rules - 1- 4-7 digits - cant be immediately followed by - or text - cant be after ? - cant be after # here are some test urls https://acme.com/cammins-1022 2- cant be immediately followed by - or text 3- cant be after ? 4- cant be after # here are some test urls https://acme.com/cammins-1022 https://acme.com/francr-cameron-cummins-1022#home https://acme.com/franchiummins-1025642?somthing https://acme.com/cammins-1022 https://acme.com/francr-cameron-cummins-1022#home-321321-sadfg https://acme.com/franchiummins-1025642?somthing-321321 https://acme.com/franchiummins-1025642-?somthing-321321
Get ID from url path - regex
Need some help getting IDs out of urls. Seems they can be 4-7 digits and i have the following rules . if possible can you use this https://regex101.com/ so we can easily test it. here are the rules 1- 4-7 digits 1- 4-7 digits 2- cant be immediately followed by - or text 3- cant be after ? 4- cant be after # here are some test urls https://acme.com/cammins-1022 https://acme.com/francr-cameron-cummins-1022#home https://acme.com/franchiummins-1025642?somthing https://acme.com/cammins-1022 https://acme.com/francr-cameron-cummins-1022#home-321321-sadfg https://acme.com/franchiummins-1025642?somthing-321321 https://acme.com/franchiummins-1025642-?somthing-321321
Back to question