April 28th, 2009, 08:27 AM
It makes the matching at the last of the string
I want to transform from this:
Using this regex:
And replace with:
I receive this results:
Do you have an idea how to make the matching at the beginning?
April 28th, 2009, 06:22 PM
So are you redirecting all URLs or just some of them?
April 28th, 2009, 08:36 PM
you don't need a regular expression. just use simple split and join
$string = "http://web.domain2.net/about-us/ggg/xxx/a/b/c/d/e/";
@l = split /\//,$string;
$l = "new.domain.com";
April 29th, 2009, 04:45 AM
I need to insert it into Apache conf.
April 30th, 2009, 04:58 AM
How about using this?
Is this what you wanted?
I tested it with Regular Expressions Tester and it isn't a valid regex
Oh yeah, seems like I forgot to escape the "/"s in there.
But please look away from that as I see a problem with the whole pattern now.
I also see now that I misunderstood what you asked for when I gave you my solution earlier.
Unfortunately, it does not seem like I am able to to assist you with the regex pattern after all.
I think it will be much easier to just write a script to do it for you rather than use regex (unless someone else here knows a way).