PHP code example of antevenio / stream-regex-iterator
1. Go to this page and download the library: Download antevenio/stream-regex-iterator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
antevenio / stream-regex-iterator example snippets
$inputString = "line1\nline2\nline3\nline4\nline5\nstart\nline6\nline7\nend";
$stream = fopen("data://text/plain," . $inputString, "r");
$matches = new Antevenio\StreamRegexIterator\Iterator(
"/^start.*?end$/sm",
$stream,
32
);
foreach ($matches as $match) {
print_r($match);
}
preg_match_all()
preg_match_all()