(Topic summary under the line.)
Regex, at least the formal definition featuring only | and *, is used to describe words accepted by a given FSA, but it can be transformed into the corresponding state diagram (by constructing a NFSA with epsilon transitions from "modules" that correspond to the concatenations, alternations and Kleene stars in the regex, and then deriving the DFSA from that). Thus, it is as if regex captures the "essence" of state diagrams, which are just oriented graphs; a way to encode the entire graph in a single string.
A DFSA needs to have as many outgoing transitions per each state as there are symbols in the chosen alphabet. Let's assume two for our alphabet L: 0 and 1. These symbols can be understood as if-else statements, the machine takes one path if it sees a 0, and a different path for 1. We can provide substitutions of the form 0->0A, where A is some set of tape instructions. Choosing the right syntax semantics for the context-free aspects of these strings then allows us to omit the 0's and 1's entirely. For example, replace ()* with [], so that [A]B reads "while 1, A, else end while, B". Similarly, since |L|=2, we can ultimately reduce every alternation to the form (A|B) (so for example no expressions of the "(A|B|C)" kind), and thus we can rephrase this as "if 1, A, else B, end if". Finally, for pesky cases where the while condition is inverted, we can define "![]" for now, which reads "while 0...".
Example Busy Beaver-esque automaton (state 1 = initial, state 0 = halting):
State 1: if ( read 1 ) { A; state = 2; } else { B; state = 0; }
State 2: if ( read 1 ) { C; state = 2; } else { D; state = 1; }
Where A, B, C, and D are instructions for the tape-manipulating machinery.
Compact code for this state-transition table: 2021
String representation of the instructions themselves: [A[C]D]B
Informal proof of the correctness of the above string: If the first read symbol is 0, the first [] won't execute and B will execute instead; the halting state will follow. Otherwise if 1, do A and transition to state 2 (not deducible from the string). Then, if read 1, do C and don't change states, aka "[C]". Finally, otherwise if 0, do D and go to state 1, which was the same as the initial one, ergo return to the beginning of the string (the first "[").
The very much esoteric language Brainfuck is notorious for its simplicity, and the only control flow it provides is a "while (true)"-style loop "[]". However, it is my suspicion that not every state diagram can be constructed in Brainfuck, or this experimental language of mine. For a machine with the code "2001", I couldn't find a string that wouldn't utilize gotos/breaks. (My attempt: [A(C*,D)]B, where * means to break from []; "(,)" as usual means if-else). It seems that while every state diagram can be converted into regex, once we give each edge a unique label and aim to preserve them and their paths, the task becomes impossible in some instances, namely when there is a loop with two or more exits.
My question: if FSAs have regex, what do Turing machines have? Is there some succinct way to represent their state diagrams using a single string? Brainfuck seems like a good candidate at first, but it probably cannot describe every possible state diagram; at least that is my guess. No one programs by drawing state diagrams, programs are written (stored) as inline strings of symbols, hence my interest.
Additional question: how come Brainfuck is Turing-complete without selections (if-else statements), how come iterations (while loops) can substitute for selections, and is there a human-friendly algorithm for this? (I am aware of the structured program theorem, but that one includes selections. I am seeking proof of the substitution claim.) Moreover, it seems like some state diagrams cannot be described solely using context-free structures and require gotos/breaks. Is there proof for this, and what does this tell us about Turing completeness or programming language design? (For one, I know it breaks the context-free syntax, but I wish to learn more.)