Test, validate and match regular expressions
This PCRE2 regex matches medical patient records or logs, capturing an account number, patient name, location, and optionally room and bed information. It is designed to parse lines that specifically end with the phrase 'Primary Dx', making it ideal for extracting structured data from clinical text files.