.htaccess - Need regex to match two rather similar URL patterns -


I need a regex (can be used in .htaccess) with the following properties, the number of four digits and After capturing the text:

Match:
/ 9876 / text_text_more_text_still_more_text
/ 8765 / 1234_text_text_text

does not match:
/ 2010 / 08/01 / Text_text_more_text_still_more_text
/ 2010/08/01 / text-text-more-text-still-more-text

I still have:
/ ([0 - 9] +) / ([^ - /] +)

This unfortunately matches a non-match-match pattern. I am definitely a newbie at Reggae, but I feel that if I had an indicator in the right direction then I could understand it.

Thanks in advance.

Try it:

  ^ / (\ d {4} ) / (\ W +) $  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -