xpro
Regular Member
- Jan 21, 2009
- 442
- 24
Hello
I'm trying to extract some data from a webpage and it should create 2 separate matches, but the regex keeps on going and it makes it as one match. What can I do so that it can stop at the first "</from>" it finds?
Best Regards!
The content
My regex
I'm trying to extract some data from a webpage and it should create 2 separate matches, but the regex keeps on going and it makes it as one match. What can I do so that it can stop at the first "</from>" it finds?
Best Regards!
The content
Code:
<messageInfo mid="1_449_ALlVimIAABd1TC5hsgc16zIYJFY" toEmail="Idelle" subject="Re: free ipod" mimeType="multipart/alternative" xapparentlyto="[email protected]" receivedDate="1278108078" size="7408"><flags isReplied="0" isFlagged="0" isRead="1" isDraft="0" isForwarded="0" isHam="0" isSpam="0" hasAttachment="0" inAddressBook="0" isRecent="1"/><from><name>LaVonda Bland</name><email>[email protected]</email></from><inboxservices><name>Retro</name><value>Y</value></inboxservices><inboxservices><name>SgrnP</name><value>N</value></inboxservices><inboxservices><name>d_t</name><value>1278108081</value></inboxservices><inboxservices><name>s_ip</name><value>74.6.228.93</value></inboxservices><inboxservices><name>showStationery=</name><value/></inboxservices><inboxservices><name>url</name><value>craigslist.org,mailto:[email protected],yahoo.com,mailto:[email protected]</value></inboxservices></messageInfo><messageInfo mid="1_22_ALVVimIAABo+TC1qtAhqDS72Xas" toEmail="[email protected]" subject="Welcome to Yahoo!" mimeType="text/html" receivedDate="1278044852" size="720"><flags isReplied="0" isFlagged="0" isRead="0" isDraft="0" isForwarded="0" isHam="0" isSpam="0" hasAttachment="0" inAddressBook="0" isRecent="1"/><from><name>Yahoo!</name><email>[email protected]</email></from>
My regex
Code:
<messageInfo mid=\"(.*?)\" toEmail=\".*?\" subject=\"(.*?)\" mimeType=\".*?\" xapparentlyto=\".*?\" receivedDate=\".*?\" size=\".*?\"><flags isReplied=\"0\" isFlagged=\"0\" isRead=\"0\" isDraft=\"0\" isForwarded=\"0\" isHam=\"0\" isSpam=\"0\" hasAttachment=\"0\" inAddressBook=\"0\" isRecent=\"1\"/><from><name>(.*?)</name><email>(.*?)</email></from>