note 15790 deleted from pcre.pattern.modifiers by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 12:19:18 +0000 |
| Subject: | note 15790 deleted from pcre.pattern.modifiers by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57414@lists.php.net to get a copy of this message | ||
Note Submitter: php-general@lists.php.net
----
Find the PGP keys within a block of text using a Perl-style regular expression
modified with the the "dot all" (s) and ungreedy (U) pattern modifiers.
<?php
/* Change the file name used below in file()
** or use another data source! :)
*/
$data = implode ('', file ('text_with_pgp_keys.txt'));
preg_match_all(
...."/-----BEGIN PGP PUBLIC KEY BLOCK-----.+-----END PGP PUBLIC KEY BLOCK-----/sU",
....$data,
....$matches
);
print_r ($matches);
?>