
Are you a QOTWer? Do you want to start a thread that isn't a direct answer to the current QOTW? Then this place, gentle poster, is your friend.
( , Sun 1 Apr 2001, 1:00)
« Go Back | See The Full Thread

As above, you need to handle different lenth area codes and the possibility of a dash, space or not between the area code and the number...
Also, you need to drop the leading 0 to put the 44 on the start.
So maybe something a bit like this...(Using a php base for the pseudo code)
$cleannum = preg_replace('/0?([0-9]{4,5})[^0-9]?([0-9]{6,7})/', '0044\1\2', $num)
HTH.
Edit: Sorry, didn't spot it had been solved a lot more completely by that HUUUGE monster above!
( , Sun 7 Jun 2009, 14:38, Reply)
« Go Back | See The Full Thread