I'm trying to match against urls like
What I have so far (I hate regex)
select id,CAST(REPLACE(url, 'my-url-', '') AS UNSIGNED) as urls from tbl_url
where url REGEXP '^/my-url-[0-9]+$'
I need to make the last dash followed by numbers optional, so if there is just this in the db
Then I end up with 0 as urls
If this exists in the db
Then I would end up with 1 as urls