I am trying to format date entered by user. 
Dates are provided in the following format:

* d/M/yyyy (ie: 1/1/2012, but could be also 12/1/2012 or 1/12/2012)

however I need them converted to:

* dd/MM/yyyy (ie: 01/01/2012)

I managed to do it in non-Regex way, like this:

```
    string date = "1/1/2012";

    if (date.IndexOf("/") == 1)
    {
        date = "0" + date;
    }
    if (date.Substring(4, 1) == "/")
    {
        date = date.Insert(3, "0");
    }

```

I would really like to know how to do it with Regex.Replace, however, as it would probably be neater.

I tired different variations of the below: 

```
    string date = "1/1/2012"

    date = Regex.Replace(date, @"\d{1}/", "0$&");

```

The above will work, but if the date is 12/1/2012, it will also make 102 out of 12. If I add ^ at the beginning of pattern I don't get the second number changed. I also tried combinations with [^|/] at the beginning, but also no luck. So at the moment it is either or.