Make extension optional in htaccess RewriteRule
===

I've got the following code in .htaccess: -

    Options +FollowSymLinks 
    RewriteEngine On 
    RewriteRule ^([^/]+)/([^/]+)(.pdf)$ showpdf.pdf?product_code=$1 [NC,QSA,L]

which takes a request in the format (for example): -

    /ab-cde-123/anything-can-go-here.pdf

and rewrites it to: -

    /showpdf.pdf?product_code=ab-cde-123

And this works fine. However, I want to change it slightly so that everything after the last / in the request is optional, for example so that all 3 of these would work as requests: -

    /ab-cde-123/anything-can-go-here.pdf
    /ab-cde-123/anything-can-go-here
    /ab-cde-123/

Any help would be much appreciated!