Skip to content

Instantly share code, notes, and snippets.

@stevenrombauts
Last active December 27, 2015 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenrombauts/7280564 to your computer and use it in GitHub Desktop.
Save stevenrombauts/7280564 to your computer and use it in GitHub Desktop.
Parse changelog using regular expression.
<?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