.htaccess regex to find the last occurence for a match
I am trying to get the last occurrence of a particular match in a url, this is the line I currently have `RewriteRule ^([a-zA-Z[0-9\-.]+/?)$ index.php?p=$1 [QSA,L]`.

So for example the following url `/first-part/second-part/` needs to return a get variable of p='second-part' whereas `/first-part/` needs to return a variable of p='first-part'
.htaccess regex to find the last occurence for a match
===

I am trying to get the last occurrence of a particular match in a url, this is the line I currently have `RewriteRule ^([a-zA-Z[0-9\-.]+/?)$ index.php?p=$1 [QSA,L]`.

So for example the following url `/first-part/second-part/` needs to return a get variable of p='second-part' whereas `/first-part/` needs to return a variable of p='first-part'