Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression Help
#1
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.

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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)