I am learning regex. I have a very simple question:
I have a long string of content in php.I would like to convert all places where it says:
http://www.example.com/en/rest-of-url
to
http://en.example.com/rest-of-url
Could somebody help me with this? I think I use preg_replace for this?
Bonus: If you have a link to a good site which explains how to do the simplest things like this in regex, please post it. Every regex resource I look at gets very complicated very fast (even the Wikipedia article).