c# - Construct redirect URL with RegEx -
how use regex redirecting example
exemple.com/en/solution/platform-features
to
exemple.com/en/platform-features
if intention remove third element should it
var reg = new regex(@"(?<begin>([^/]*/){2})[^/]*/(?<end>.*)"); var match = reg.match(@"exemple.com/en/solution/platform-features"); var result = match.groups["begin"].value + match.groups["end"].value;
Comments
Post a Comment