Regex for this is overkill.
It’s too heavy, and considering the format of the string will always be the same, you’re going to find it easier to debug and maintain using splitting and substrings.
class Program {
static void Main(string[] args) {
String s = "<A HREF=\"/data/client/Action.log\">Action.log</A><br> 6/8/2015 3:45 PM ";
String[] t = s.Split('"');
String fileName = String.Empty;
//To get the entire file name and path....
fileName = t[1].Substring(0, (t[1].Length));
//To get just the file name (Action.log in this case)....
fileName = t[1].Substring(0, (t[1].Length)).Split("https://stackoverflow.com/").Last();
}
}
2
solved Regex pattern for file extraction via url?