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?
Loading
SivaRamaKrishna RajuPosted Jan 12, 2011, 2:16 AM
Please clear about your requirement, because you given an example, this example is not clear
In both cases you need "/Test/plans", how it is possible
in the pathname1 contains path as /Test and plans.aspx is the file in that path
in pathname2 contains path as /Tests/plans and error.aspx is the file in that path
you need path means /Test in pathname1 and
/Tests/plans in pathname2,
First clear about your functionality then let us know your requirement.
Thanks and Regards,
SivaRamaKrishnaRaju..