So i'm working on some mod_rewrite stuff for a new website... I've got this to work
URL -http://www.somesite.com/listings/my-test-listing-222.html
rewriterule listings/([/]+).html$ listings.php?listingID=$1
but I really just want the numbers... so i tried this
listings/([0-9]+).html$ listings.php?listingID=$1
The first one works.. the second one yields up a 404.. :(
listings/([a-z-]+)([0-9]{1,}).html listings.php?listingID=$2
Adjust what is in bold for what it is that you want to allow in a URL string. Right now it'll just allow a-z and -
wow.. thx.
so.. is the reason mine didn't work because I wasn't allowing for the text before the numbers?
You were basically accepting everything up until the .html to be passed in on your rewrite rule for listing id. With the rewrite rules you'll want to compound expressions a bit to get the match. they take a decent amount of playing around with to get it right.
This is a useful little tool for testing your .htaccesshttp://htaccess.madewithlove.be/
I ended up going with this..
URL -http://www.somesite.com/listings/this-listing-22/242.html RewriteRule listings/([A-Za-z0-9-]+)/([0-9]+).html$ listings.php?title=$1&ID=$2
I found that with your expression if there was a number in the name.. it would screw it up. I still don't understand regular expressions at all... but I really appreciate the help. 
That is the safer way to go. But yes, the expression i put in there would be listings + (any letter and a "-") + (any number 1 or more times) + .html