c# - Regular expression help for URL -
c# - Regular expression help for URL -
i have url this:
http://www.domain.com/sponsor/xxxxx/reo/news
it needs end beingness rewritten to:
http://www.domain.com/reo/news?brokerid=xxxxx
i'm terrible @ regular expressions. how can extrapolate "xxxxxx" source url , transform string end result?
i don't need much help creating end result, that's pretty trivial, if there's nice, clean way regex versus raw string manipulation, that'd nice know about.
use "http://([^/]+)/sponsor/([^/]+)/reo/news"
regexp.
use , "http://$1/reo/news?brokerid=$2"
as replacement string.
i tried illustration on .net regex tester, , produced desired output.
c# regex url-rewriting
Comments
Post a Comment