06-05-2007, 04:04 AM
Hi,
I know I should be able to answer this myself, but I can't seem to get the hange of regular expression syntax.
What I want to do is fairly simple: extract the variable text between two regular bits of text:
e.g.
I want to be able to extract John Doe and place in a string e.g. ptname
extract MRN and place in str mrn.
These are separated by lines.
It seems like I should be able to grab all the characters between the two words e.g. Name and MRN and then trim the extra off, but I can't get it to work.
Any suggestions?
Thanks,
Stuart
I know I should be able to answer this myself, but I can't seem to get the hange of regular expression syntax.
What I want to do is fairly simple: extract the variable text between two regular bits of text:
e.g.
Quote:Name: John Doe
MRN: 12345678
exam: xray
I want to be able to extract John Doe and place in a string e.g. ptname
extract MRN and place in str mrn.
These are separated by lines.
It seems like I should be able to grab all the characters between the two words e.g. Name and MRN and then trim the extra off, but I can't get it to work.
Any suggestions?
Thanks,
Stuart