Set builder notation: Colon or Vertical Line I remember once hearing offhandedly that in set builder notation, there was a difference between using a colon versus a vertical line, e.g. $\{x: x \in A\}$ as opposed to $\{x\mid x \in A\}$. I've tried searching for the distinction, but have come up empty-handed.
 A: It seems many good answers and examples have been provided, but I didn't see it mentioned above that regardless of which symbol you choose to use, in the set builder context both would be read aloud as "such that". 
As for my example of preference, I am often working in number theory so I use the colon, ":", to avoid the bar being misinterpreted as "divides", or aesthetic reasons if I am also going to use the bar to mean divides in the specification of the set.
A: There is no difference that I've ever heard of. I do strongly prefer "$\vert$" to "$\colon$", though, because I'm often interested in sets of maps, and e.g. $$\{f \mid  f\colon \mathbb{R}\rightarrow\mathbb{C}\text{ with $f(6)=24$}\}$$ is easier to read than $$\{f: f\colon \mathbb{R}\rightarrow\mathbb{C}\text{ with $f(6)=24$}\}$$.
EDIT: Note that as Mike Pierce's answer shows, sometimes "$:$" is clearer. At the end of the day, use whichever notation is most clear for your context. 
A: There is no difference. The bar is just often easier to read than the colon (like in the example in Noah Schweber's answer). However in analysis and probability, the bar is used in other notation. In analysis it is used for absolute value (or distance or norms) and in probability it is used in conditional statements (the probability of $A$ given $B$ is $\operatorname{P}(A \mid B)$). So looking at bar versus colon in sets with these notations
$$
  \{x \in X \mid ||x|-|y_0||<\varepsilon\} 
  \quad\text{vs}\quad
  \{x \in X : ||x|-|y_0||<\varepsilon\}
$$
$$
  \{A \subset X \mid \operatorname{P}(B \mid A) > 0.42\}
  \quad\text{vs}\quad
  \{A \subset X : \operatorname{P}(B \mid A) > 0.42\}
$$
it can be better to use the colon just to avoid overloading the bar.
A: Both are acceptable means and practices within the community.  Most people I know prefer the line method because it provides a clear separation and can be used if you are defining your set on multiple lines of scratch work. 
A: I recently realized I read them differently.  To me | acts more like a "filter" over a larger set, whereas : acts more like a "generator" from a smaller expression.
This isn't 100% accurate though. I'm usually fine with : acting like a filter as well... but less so with | acting like a generator.
For example, this looks jarring to me:
\begin{align}
t^* = \max \left\{ t_i\ \middle|\ \frac{\partial f_i}{\partial x_i} = 0 \right\}
\end{align}
whereas this looks fine to me:
\begin{align}
t^* = \max \left\{ t_i : \frac{\partial f_i}{\partial x_i} = 0 \right\}
\end{align}
This is because when I read $t_i\ |\ \ldots$ I expect the right-hand side to contain some constraints on the possible values of $t_i$, which I otherwise assume to be all reasonable values (e.g. all real numbers).
But when I read $t_i : \ldots$ I expect to see an expression that tells me how to generate the set of $t_i$, and that need not involve $t_i$ itself at all.
I don't know if everyone reads them like this, but for me they are not quite always interchangeable, even though they frequently are.
