regular expression doesn't do any redirect.
I understood your above brief description that you want to extract server/domain name from an URL....
can you explain what you're in fact trying to do?
For my task approval I'm using the "Approval URL" reference from the Common tab.
Let's say the fully qualified domain name of my site is:
Once the approver clicks the url to accept/decline the workflow, the task opens in this format.
Because the task URL is not the same as the first one, the task url doesn't work on mobile devices.