TITLE: I thought the | symbol meant "divides by", but in set theory, does it mean something different?
QUESTION [8 upvotes]: I thought the | symbol meant "divides by", but in set theory it seems that it means "such that."  However, I thought we wrote "such that" as :.
Can anybody elaborate?

REPLY [4 votes]: Usually, in elementary number theory and the like, the symbol "$\mid$", which is typeset by \mid, means "divides." That is, $2\mid 4$ means "$2$ divides $4$," whereas something like $2\not\mid 3$ would mean "$2$ does not divide $3$." The difference between : and | in set theory is really a nominal one. The symbol | is used in set-builder notation. The linked to page gives a description of this notation in use when describing the set of even integers:
$$
\{a\mid a\in\mathbb{Z}\quad\text{and}\quad\exists p\in\mathbb{Z}\;(a=2p)\}.
$$
There really is not any important difference so as to invalidate one use of : as opposed to |. As stated, this difference is a nominal one (i.e., "in name only"...or, in this case, "in symbol only"). 

Added: As can be seen on this page, in the section explicitly devoted to "such that," common indications of "such that" in mathematics include :, |, and s.t. ... as others have pointed out though, there truly is a bewildering array of symbols and ways people can communicate "such that" in mathematics. I have seen $\ni$ before, as Omnomnomnom points out, and I may have seen one or two other notations, but the important point is this: pick a notation and stick with it. Don't start changing it around. That may confuse readers, and it may lead people to believe that there actually is a difference, when, in fact, there is not.