fork download
  1. <?php
  2. $email = "Hi John Doe,\n" .
  3. "Here comes some more text.\n" .
  4. "And even more, and more, and more text.\n" .
  5. "Your user ID is: 1234\n" .
  6. "Your activation ID is: 5678910\n" .
  7. "Even more text comes here.";
  8. $pattern = '/Hi (.*?),\n.*?user ID is: (\d+).*?activation ID is: (\d+)/s';
  9. preg_match($pattern, $email, $m);
  10. print("$m[1]\n$m[2]\n$m[3]");
  11. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
John Doe
1234
5678910