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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -