The term "regular expression" (or "regex") comes from a mathematical background.
Something called a "finite state automaton" or "finite state machine" is a model
of computation where there exists:
A finite set of states;
A start state;
A set of inputs;
A set of final states; and
A set of transitional states.
Regular expressions are a kind of like a way to express this - so that a set of
inputs and a start state can be fed into a finite state machine, and a final
state obtained.