php - Correct regular expression -


i need php regex matches http://bla/bla/bla/variable-text/numbers/

where blass same, variable text changes , can have inside minus (-) , after slash numbers there 5 digits.

i've tried regex, i'm quite rusty , cannot find right one, 1 i've tried

/(http:\/\/bla\/bla\/bla\/)([:alnum:]-)\/([:num:]{5})/ 

but doesn't work.

any suggestion?

thank you!

you can use regex in php:

~\b(http://bla/bla/bla)/([\da-z-]+)/(\d{5})\b~i 

working demo


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -