b3ta.com qotw
You are not logged in. Login or Signup
Home » Question of the Week » Off Topic » Post 442003 | Search
This is a question Off Topic

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)
Pages: Latest, 836, 835, 834, 833, 832, ... 1

« Go Back | See The Full Thread

Hmm, tricky one
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

Pages: Latest, 836, 835, 834, 833, 832, ... 1