fork download
  1. <?php
  2.  
  3. function GetSummary($String) {
  4. $re1='.*?'; // Non-greedy match on filler
  5. $re2='(SUMMARY)'; // Word 1
  6. $re3='(:)'; // Any Single Character 1
  7. $re4='(.*?)'; // Non-greedy match on filler
  8. $re5='\n'; // Any Single Character 2
  9.  
  10. if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4.$re5."/is", $String, $matches))
  11. {
  12. $word1=$matches[1][0];
  13. $c1=$matches[2][0];
  14. $word2=$matches[3][0];
  15. return $word2;
  16. } else {
  17. return "NO MATCH";
  18. }
  19. }
  20.  
  21. $data = <<<EOB
  22. UID:5F12F7DA-10B0-4EE3-820D-B56F0B2FC153
  23. DTSTAMP:20120408T041113Z
  24. CLASS:PUBLIC
  25. CREATED:20120408T041113Z
  26. DESCRIPTION:Testfghfghfghfghfghfghfghfghfghfghfghfghfghfghfgh
  27. DTSTART;TZID=America/New_York:20120410T000000
  28. DTEND;TZID=America/New_York:20120419T010000
  29. LAST-MODIFIED:20120408T041228Z
  30. LOCATION:Philadelphia\, PA
  31. SEQUENCE:1
  32. SUMMARY:Test
  33. TRANSP:OPAQUE
  34. EOB;
  35.  
  36. echo GetSummary($data);
  37.  
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Test