J Moreno

J Moreno

  • NA
  • 7
  • 3k

Help! Need a regex pattern to parse a string from pathname URI

Jan 10 2011 2:03 PM


I'm working with asp.net C# and need a regex pattern to extract a portion of a pathname URI.
Example:

pathName1 = "/Tests/plans.aspx";
pathName2 = "http://mydomain.com/Tests/plans/error.aspx";

In both cases I need the pattern to extract "/Test/plans" from the given pathname.  How would I do this?

Answers (1)