Of course, back in the day, you could restrict it to 0171
Even further back in the day, 01 was the dialling code for all of London.
From wiki:
STD code[edit]
Example telephone number
1959–1966 STD codes introduced 01-WIM 0123
1966–1990 All-figure dialling 01-946 0123
1990–1995 Area code split 071-946 0123
1995–2000
PhONEday 0171 946 0123
2000–present
Big Number Change 020 7946 0123
The
STD code 01 was assigned to the London telephone area on 6 April 1959 as part of preparations for
subscriber trunk dialling.
[11]For the next thirty years, "01" became synonymous with the capital.
[12] Until May 1990, the 01 code covered the same area as the current 020 code and had capacity for fewer than 10 million telephone numbers.
[13]
In May 1990, the 01 code was abandoned and the area divided between 071 – which covered exchanges in the Central sector – and 081, which covered all other sectors. Exceptionally, two exchanges in the East sector
[notes 3] covering the
London Docklands redevelopment area were assigned the 071 code.
[14]The anticipation that the code associated with central districts would be more prestigious than the other associated with the outer suburbs
[15][16] was used as a plot device in the Essex-based TV comedy series
Birds of a Feather.
[17] At the time of the split, there were five local exchange codes assigned to
Mercury Communications[notes 4] and numbers in these ranges could be assigned to either code.
[14] This area code split doubled the potential capacity.
[13] In 1995, on "
PhONEday", the codes changed again, to 0171 and 0181.
My home town, Brentwood, is conveniently placed just outside the M25, although I expect it'll soon be swallowed up by the spreading mass of the capital.
So I would say that London is within the confines of the M25.