Hyvor Developer
  Home   Download   Copy
Code
<?php
$str = 'The Mother: Maxim Gorky - 1906';
preg_match('/(?P<book>[\w\s]+): (?P<author>[\w\s]+) - (?P<year>\d+)/', $str, $matches);

echo 'Book: ' . $matches['book'] . '<br>';
echo 'Author: ' . $matches['author'] . '<br>';
echo 'Year: ' . $matches['year'];
Result