在线正则表达式测试
http://erik.eae.net/playground/regexp/regexp.html
Input Text
http://www.radsoftware.com.au/web/
http://www.radsoftware.com.au/web/Default.aspx
http://www.radsoftware.com.au
http://www.radsoftware.com.au/web/CodeZone/Default.aspx?from=RegexDesigner
Regular Expression
(?<protocol>http|ftp)://(?<domain>[^//r/n]+)(?<path>/[^/r/n]*)?
Replace Expression
protocol: '${protocol}'
domain: '${domain}'
path: '${path}'
Replace Results
protocol: 'http'
domain: 'www.radsoftware.com.au'
path: '/web/'
protocol: 'http'
domain: 'www.radsoftware.com.au'
path: '/web/Default.aspx'
protocol: 'http'
domain: 'www.radsoftware.com.au'
path: ''
protocol: 'http'
domain: 'www.radsoftware.com.au'
path: '/web/CodeZone/Default.aspx?from=RegexDesigner'
请查看 Match Result.