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

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -