Reputation: 362
I want to replace strings like
Dependencies\myfolder\1\2\abc.dll
Dependencies\myfolder\abc.dll
Dependencies\myfolder\1\abc.dll
with
packages\abc.dll.
What is the suitable regex pattern to do this. I was expecting the pattern to be -
Dependencies*abc.dll
So my code is -
var newEntry = packages\abc.dll;
var pattern = Dependencies*abc.dll;
var allText = ""; //this contains the text read from a file
Regex rgx = new Regex(pattern);
rgx.Replace(allText, newEntry);
But this seems to be a wrong regex pattern.
Upvotes: 1
Views: 59