I have a reqrite rule that is almost doing what I want. I would appreciate some info on how to tweak it.

```
RewriteRule ^gallery(/(([a-zA-Z0-9-]+)/?)?)?$ gallery.php?groupId=$3 [NC,QSA]

```

this rule works but I need it to handle one more argument like this

```
RewriteRule ^gallery(/(([a-zA-Z0-9-]+)/?)?)?$ gallery.php?groupId=$3**&showpage=$6** [NC,QSA]

```

I need the rule to handle

```
gallery
gallery/
gallery/somegroupid
gallery/somegroupid/
gallery/somegroupid/2
gallery/somegroupid/2/

```

I appreciate the input.
Thanks.