separated shared and generated text, fixed regex