2014-10-27 101 views
-2

一个词或数字我有包含提取使用正则表达式

$mystring = "------------------------ 
------------------------ 
<p> 
<pre><small> 
MessageID=542E7A07, Recipient=1111111111 
</small></pre> 
------------------------ 
------------------------"; 

我想获得使用正则表达式的邮件ID和收件人的第一个字符串。

+0

即使使用正则表达式时,有很多表情来试试,它是某种基本的正则表达式的技巧。 – 2014-10-27 03:50:57

+0

感谢您的回复我尝试作为$ result = preg_match_all(“/(?<=(MessageID =))(\ s \ w *)/ i”,$ mystring,$ exresult); – newcomer 2014-10-27 03:57:44

+0

你想要两个单独的结果还是整行? – hwnd 2014-10-27 04:06:09

回答