Regular expresion in php to search url with a given pattern

I want to search a given text for local urls in link’s href attributes, using regular expression. Curently I have a regular expression:


but I’d like to add some more filtering:
Only get those links, which start like this:


Where X is a number. This should match this: 2015-05-15/, 2015-05-15_03_21_32/ and also 2014-12-21 (any date set by me).

Thanks for the answers!

Source: regex

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.