Local corrections on string processing:

* Corrected regexp: `[x|y]` -> `[xy]`.
* Used an re:replace/4 option instead of multiple IOlist functions.
Local corrections to list processing:

* Use lists:flatmap/2 instead of lists:foldl/3 . lists:append/2.
* Replace lists:foldl/3 over a list, with lists:flatmap/2.
* Order of generated list is same as before those changes.
A list of fixed size? A tuple.

A constant-size list was created and passed around; I
figured a tuple was better.