php regular expression
Posted: Wed Nov 05, 2008 9:56 am
Hi
I want to replace every 4th and higher occurence of "." with / in a string.
For eg:
if i have some string like http://www.google.com.news , http://www.google.com.sports, then I would like to have something like http://www.google.com/news and http://www.google.com/sports
How do i do it with regular expression ??
I want to replace every 4th and higher occurence of "." with / in a string.
For eg:
if i have some string like http://www.google.com.news , http://www.google.com.sports, then I would like to have something like http://www.google.com/news and http://www.google.com/sports
How do i do it with regular expression ??