Last active
December 27, 2015 06:19
-
-
Save stevenrombauts/7280564 to your computer and use it in GitHub Desktop.
Parse changelog using regular expression.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$changelog = <<<EOL | |
ADDED-Complete new frontend default theme. Optimised to easily blend into any Joomla template. | |
added: Fully refactored administrator to fully match Joomla 1.5's native look and feel | |
Wuuut? Testing, testing. | |
fixed DOCLlink, search plugin and modules are now included in the package and installed automatically | |
improved Performed a full security audit | |
improved | |
added - Performance optimizations | |
EOL; | |
$result = preg_match_all('/^(fixed|added|improved)[ :;\-]+\b(.+)$/im', $changelog, $matches, PREG_SET_ORDER); | |
echo "$result matches found!".PHP_EOL; | |
foreach($matches as $match) | |
{ | |
echo strtoupper($match[1]) . ' - ' . $match[2] . PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment