I have the following string: aWesdE
, which I want to convert to http://myserver.com/aWesdE.jpg
using Regex.Replace(string, string, string, Re
There are actually 2 matches in your Regex. You defined your match like this:
string match = "(.*)";
It means match zero or more characters, so you have 2 matches - empty string and your text. In order to fix it change the pattern to
string match = "(.+)";
It means match one or more characters - in that case you will only get a single match