Reference for cohomology vanishing If $U \subset \mathbb C^n$  is the complement of a closed analytic subset of codimension at least three then there is a result of Cartan which says that $H^1(U,\mathcal O^{analytic}_U)=0$, see page 133 of "Theory of Stein Spaces" by Grauert and Remmert.
Does anyone know a reference for the analogous result in the algebraic category ? 
 A: I would try SGA2.  Often these questions are treated by a consideration of the local cohomology exact sequence (or excision, if you prefer), which has the form
$\cdots \to H^i_Z(X,\mathcal O) \to H^i(X,\mathcal O) \to H^i(U, \mathcal O)
\to H^{i+1}_Z(X,\mathcal O) \to \cdots,$
where $H^{\bullet}_Z$ denotes local cohomology with support in $Z$.
Vanishing results for local cohomology then give vanishing results for cohomology on opens,
and SGA2 is devoted to the study of such vanishing results.
A: To expand on Emerton's answer: Using the excision sequence, Cartan's result in the algebraic case boils down to showing the following: Let $R$ be a regular local ring, and $I$ and ideal of height at least $3$, then $H^i_I(R)=0$ for $i\leq 2$.This follows because: $$H^i_I(R) = \lim Ext^i(R/I^n,R)$$
And $I^n$, being height $3$, always contains a regular sequence of length $2$, so the $Ext^i$ vanishes for $i\leq 2$ by standard result (see Bruns-Herzog Cohen Macaulay book, Proposition 1.2.10 for example). This argument extends to the case of codimension at least $n$ and vanishing of $H^{n-2}$.
Incidentally, a pretty non-trivial question is to find upper bound for the vanishing of local cohomology modules, in other words, the cohomological dimension of a subvariety $Z$. Many strong results have been obtained after SGA, by Hartshorne, Ogus, Faltings, Huneke-Lyubeznik, etc. All those references can be found in
Lyubeznik's paper (they were mentioned in the very first page) which primarily treated the vanishing of etale cohomology.
