I have a XML sitemap file which looks like this
<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/web/201/hello_world1.html</loc>
</url>
<url>
<loc>http://www.example.com/web/202/hello_world2.html</loc>
</url>
<url>
<loc>http://www.example.com/web/203/hello_world3.html</loc>
</url>
</urlset>
and I want to change it to like
<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/web2/1/hello_world1.html</loc>
</url>
<url>
<loc>http://www.example.com/web2/1/hello_world2.html</loc>
</url>
<url>
<loc>http://www.example.com/web2/1/hello_world3.html</loc>
</url>
</urlset>
I want to change the different IDs 201, 202, 203 with just 1 ID, normal find and replace don't do that, Any idea how to do that in C# or suggest me a Regular Expression to do it in efficient way. Thanks