1
Answer

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

J Moreno

J Moreno

13y
2.8k
1


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)