Hi Fahad, and welcome to WebmasterWorld!
I'm afraid I cannot understand your question.
In order to understand this, we'll need to know if you want an external client redirect from one URL to a different URL, or an internal URL-to-filepath rewrite, or some other function.
An example of the "input" and the desired "output" would be most helpful. Please describe your "goal" or "purpose" and provide example URLs and filepaths as appropriate.
The regular expressions pattern you show above is extremely inefficient, and avoiding an early server upgrade may require a change to the design of your linked URLs.