For an NxNxN Rubik's Cube, each move has the form:
([UDFBRL])((?:-?[0-9]+)?)(\(-?[0-9]+\)|['"]?)
([UDFBRL]) matches the face: U = upper, D = downward, F = front, B = back, R = right, L = left.
((?:-?[0-9]+)?) matches the number of layers extending into the cube from the face to rotate. If empty, 1 is implied.
(\(-?[0-9]+\)|['"]?) matches the number of clockwise quarter turns to make: empty = (1), ' = (-1), " = (2).
Formulas surrounded by brackets followed by a number, \[...\][0-9]+, are performed that many times.