Re: note 15790 modified in pcre.pattern.modifiers by zak

From: Date: Wed, 03 Oct 2001 10:37:57 +0000
Subject: Re: note 15790 modified in pcre.pattern.modifiers by zak
References: 1 2  Groups: php.mirrors php.notes 
Request: Send a blank email to php-notes+get-18508@lists.php.net to get a copy of this message
Would be nice to have a unified diff in the mail, it's easier than a "now/before" as it is today. --Jeroen ----- Original Message ----- From: <zak@php.net> Newsgroups: php.notes To: <php-notes@lists.php.net> Sent: Wednesday, October 03, 2001 10:40 AM Subject: note 15790 modified in pcre.pattern.modifiers by zak > 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); > ?> > > --was-- > 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 > preg_match_all( > ...."/-----BEGIN PGP PUBLIC KEY BLOCK-----.+-----END PGP PUBLIC KEY BLOCK-----/sU", > ....$data, > ....$matches > ); > > print_r ($matches); > ?> > > http://www.php.net/manual/en/pcre.pattern.modifiers.php

« previous php.notes (#18508) next »