Superfluidity in nuclear and neutron matter