Five UK firms have won mandates advising some of the UK's largest banks on splitting their retail and investment banking operations to comply with incoming regulations.

The rules, recommended by John Vickers in 2011 and set to come into effect in 2019, are intended to protect the public by ensuring that if a bank were to crash its retail banking operations would be unaffected by problems in its riskier investment banking business.

With banks scrambling to reposition themselves for the new regulations a host of firms have won roles.

Barclays is understood to have turned to Slaughter and May and Addleshaw Goddard for advice, with Slaughters also thought to have been instructed by longstanding client Santander UK.

Allen & Overy and Norton Rose Fulbright have picked up the lead advisory mandates for HSBC on ringfencing matters, with A&O's role also covering the planned transfer of the bank's retail headquarters from London to Birmingham in 2017.

Linklaters, meanwhile, has the lead mandate for longstanding client Lloyds Banking Group, with the firm's team being led by banking partner Edward Chan and corporate partner Matthew Bland.

The firm is also advising a second UK bank, believed to be regular client RBS, with a team led by banking partner Benedict James and corporate partner Anne Drummond, though Linklaters declined to comment or confirm its role.

Slaughters' role for Barclays comes despite the fact the firm is not on the bank's main legal panel.

The elite firm is understood to have been advising Barclays on key strategic matters relating to the ringfencing rules for at least a year. The bank said in October 2015 that it anticipated the restructuring would cost it around £1bn. Addleshaws is acting on areas including payments and retail financial services as well as due diligence work.

One Addleshaws partner said: "You may think that Slaughters is doing the brain work and Addleshaws is taking on the brunt work but there are areas where we are doing the brain work. So the firm is pairing up on the strategic piece in some areas and Slaughters is asking us for our view."

Barclays, HSBC,  Santander, Addleshaws, A&O and Slaughters declined to comment. Lloyds, RBS and Norton Rose were approached for comment.