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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -