Stability: Added try catch for string regex parse

Important for string and regex errors so the script does not break.
Improved documentation.