regex - Match last occurence of 4 digits htaccess rewrite -


i'm wondering sort of regex use match last occurence of set of 4 digits in url.

my url being formatted this

/artist/album-4 digits-extra stuff 

in url, "4 digits" last possible occurence of 4 digits together. thing album may contain sets of 4 digits, needs match last occurrence in url.

basically need rewrite rule act follows

rewriterule ^(.*)/(.*)-(.* match last occurence of 4 digits)-(.*)?$ album.php?artist=$1&album=$2&releaseyear=$3&extra=$4 

is there way this?

i use rule:

rewriterule ^(.*)\/(.*)-(\d{4})(?:-(.*))?$ album.php?artist=$1&album=$2&releaseyear=$3&extra=$4 

try it


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -