Rewrite Rule Conditions

Hi all, I’m trying to make a rewrite rule for my main site URLS. The two URLs I’m wanting is as follows:

Instead of:

Instead of:[COLOR=“Red”]&sizes=6-7+Years[/COLOR]

The bits in red are optional depending on whether the use wishes to filter their results on the list page.

My current rewrite rule which is working perfectly for the list page is as follows:

RewriteRule ^(.)/(.)/(.*)$ index.php?main_page=$1&section=$2&sizes=$3&id=$4 [L]