fork(1) download
  1. <?php
  2. $bodyMessage = <<<EOT
  3. Some random text up here
  4.  
  5. http://t...content-available-to-author-only...h.com/2012/07/20/kickstarter-flashr-wants-to-make-the-iphones-bezel-a-massive-notification-light/?grcc=88888Z0ZwdgtZ0Z0Z0Z0Z0&grcc2=835637c33f965e6cdd34c87219233711~1342828462249~fca4fa8af1286d8a77f26033fdeed202~510f37324b14c50a5e9121f955fac3fa~1342747216490~0~0~0~0~0~0~0~0~7~3~
  6.  
  7. http://t...content-available-to-author-only...h.com/2012/07/20/last-day-to-purchase-extra-early-bird-tickets-for-disrupt-sf/
  8. EOT;
  9.  
  10. preg_match_all('((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)', $bodyMessage, $matches, PREG_PATTERN_ORDER);
  11.  
  12. print_r( $matches);
  13. ?>
Success #stdin #stdout 0.03s 13064KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => http://t...content-available-to-author-only...h.com/2012/07/20/kickstarter-flashr-wants-to-make-the-iphones-bezel-a-massive-notification-light/?grcc=88888Z0ZwdgtZ0Z0Z0Z0Z0&grcc2=835637c33f965e6cdd34c87219233711~1342828462249~fca4fa8af1286d8a77f26033fdeed202~510f37324b14c50a5e9121f955fac3fa~1342747216490~0~0~0~0~0~0~0~0~7~3~
            [1] => http://t...content-available-to-author-only...h.com/2012/07/20/last-day-to-purchase-extra-early-bird-tickets-for-disrupt-sf/
        )

    [1] => Array
        (
            [0] => http
            [1] => http
        )

    [2] => Array
        (
            [0] => //
            [1] => //
        )

    [3] => Array
        (
            [0] => //
            [1] => //
        )

    [4] => Array
        (
            [0] => 
            [1] => 
        )

)