TL;DR: Yes.
Surely for this sweeping answer to make sense we should justify that there are (or could be) universal conventions on mathematical notation (since you don't specify by whom you mean the notation to be acceptable, I interpret your question as something along the lines of:
"Is it acceptable by a sufficiently large group of people sufficiently competent in mathematics to switch what is on the left side of the vertical bar with what is on the right?").
I don't think trying to produce such a justification is fruitful, even if it could be produced; so to bypass it let us suppose we are interested in practicing mathematics that are not that intermingled with foundations (say we only occasionally use the Axiom of Choice etc.). In this case as long as your notation for a specific concept is coherent with the rest of your outlook (or argument, proof etc.) and what you mean by the notation you use makes it communicable (with a sufficiently small error margin, which is quite possibly never zero) any notation you use is very acceptable. Here are a few examples:
- When I am writing on a board sometimes due to board-scarcity I even write a set with a horizontal separator, LHS (the place for the general form) on the top and RHS (the place for the characterizing property) on the bottom.
- Sometimes $\in$ and the characterizing property are joined together and the separator is not even used, first instance in the undergraduate curriculum is probably the correspondence of the normal subgroups of a group that contains a given normal subgroup and the normal subgroups of the factor group:
$$\{N\leq K\unlhd G\} \longleftrightarrow \{L\unlhd G/N\},$$
which could also be written as
$$\{K\mid N\leq K\unlhd G\} \longleftrightarrow \{L\mid L\unlhd G/N\},$$
but generally is not ($G$ and $N$ are fixed, $K$ and $L$ are dummy, so the interlocutor expects to be understood contextually).
- Sometimes it is better not to use the set-builder notation partially, e.g. when defining the topology of a set $X$, writing "let $\mathcal{T}:=\{U\in\mathcal{P}(X)\mid U\mbox{ is open}\}$" is usually not better than writing "let $\mathcal{T}$ be the set (collection) of all open sets of $X$".
The main point of the so-called set builder notation is that the separator separates what form a generic element of the set has and what their characterizing property is.
- For your first example, observe the following:
\begin{align}
A:=\{x\in\Bbb{R}\mid x^2<9\}
&=\{x\in\Bbb{R}\mid \vert x\vert<3\}\\
&=\{x\in\Bbb{R}\mid x\in]-3,3[\}\\
&=\{x\mid x\in\Bbb{R}\mbox{ and }x\in]-3,3[\}\\
&=\{x\mid x\in\Bbb{R}\cap]-3,3[\}\\
&=\{x\mid x\in]-3,3[\}\\
&=]-3,3[\\
&=\{x\in]-3,3[\mid x\in\Bbb{R}\}\\
&=\{x\in]-3,3[\mid x\in\Bbb{C}\}\\
&\neq\{x\in\Bbb{C}\mid x^2<9\},
\end{align}
where "observing" stands not for "checking that everything is in compliance with the universal terms and conditions" but for "understanding what I had in mind when I was manipulating the notation" (or "checking that everything is in compliance with the terms and conditions applicable in this instance of mathematical reasoning").
- If you prefer to be more consistent with the set-builder recipe, $S=\{m\in\Bbb{N}\vert \exists n\in\Bbb{N}: n^2=m\}$.
The examples and the comments above makes way for a somewhat heuristical explanation of the set-builder notation: In general it is preferred to specify the ambient set together with the general form of the elements of the set. This is also in accordance with the ordering of verbal explanations generally used, e.g. "let $A$ be the set of all real numbers whose square is less than $9$" (observe that this is slightly more natural than saying "let $A$ be the set of all numbers whose square is less than $9$, which also happen to be real").
Here is a "soft" exercise for you to thing about:
Not only is the use of the set-builder notation is not set in stone in practice only, this notation may be somewhat vague inherently:
- If $S$ is a set, let $P_S(x)$ be the open sentence "$x$ is an element of $S$.", where by an "open sentence" I mean a statement whose truth value $\in\{\mbox{true}, \mbox{false}\}$ is dependent on $x$:
$$P_S(x):="x\in S".$$
- If $P(x)$ is an open sentence, let $S_P$ be the set of all $x$'s which render $P(x)$ true:
$$S_P:=\{P\mbox{ is true}\}:=\{x\mid P(x)\mbox{ is true}\}=\{x\mid P(x)\}.$$
Then we have an inherent interchangability associated with LHS and RHS. This inherent interchangability is closely related to "extensionality":
Extensionality: A set is completely determined just by specifying elements.
This is a foundational issue (see Russell's paradox), but in different forms this interchange turns out to be very important, e.g. in measure theory we have the characteristic function of a given (measurable) set $A$:
$$\chi_A(x):=\begin{cases}
1,\mbox{if $x\in A$}\\
0,\mbox{if $x\not\in A$}
\end{cases},$$
which allows us to think of (measurable) sets as (measurable) functions and define a very robust integration.
An excellent book that would supplement your current study would be Mac Lane's Mathematics Form and Function, which contains (in my opinion) just enough information on foundations (and philosophy of mathematics) for doing non-foundational mathematics (and it also gives a very good sense of the "big picture"). The framework of my answer can be thought of this book also: "Form is due to functionality." (if you were to ask for an induced motto).