Question: I have a `Datagrid` where a add items using `grid.Items.Insert(0, row);`
I always want the last row I insert to be displayed first on Grid.
I also want the 1st row to have different color from others. For this purpose I am using `LoadingRow` event :

```
private void dataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
 dataGrid.RowBackground = new SolidColorBrush(Colors.AntiqueWhite);//set all rows to default color
 e.Row.Background = new SolidColorBrush(Colors.CornflowerBlue); //set current=>1st row row to BLue                                
}

```

However every row added is getting colored `CornflowerBlue` without previous added rows changed to `AntiqueWhite`.
I am missing something obvious, would really appreciate any guidance.

Answer: 
By Using BeautifulSoup as requested :

```
from bs4 import Beautifulsoup
soup = BeautifulSoup(html)
all = soup.select('li')
for i in all:
    try:
        output = re.sub(r'(?is)(href="../)([^.])','http://www.phonebook.com.pk/'+r'\2',str(i))
    except:
        output = i
    print(output)

```
You can replace string using regex, 

```
output = re.sub(r'(?is)(href="../)([^.])','http://www.phonebook.com.pk/'+r'\2',str(html))

```