Regex and context code updated for PDHO script