function parseTrack($str) {
[$first_part, $second_part] = explode(' - ', $str);
$first_part = preg_replace('~^\d+\. ?~', '', $first_part);
$artists = preg_split('~ feat\. |,~', $first_part);
$artist = $artists[0];
$feat = array_slice($artists, 1);
preg_match('~^(.*?)(?: \(([^(]+) prod\.?\))?$~', $second_part, $match);
return [
'artist' => $artist,
'feat' => $feat,
'name' => $match[1],
'beatmaker' => isset($match[2]) ? $match[2] : null
];
}
cmd.hear(/^(?:передать|перевод)\s(\d+)\s(\d+)\s(.*)/i, async (ctx) => {
const [, id, amount, reason] = ctx.$match;
// ...
});
preg_match("/(?:\r|\n)[^']*?(#.*?)(?:\r|\n)/", $str, $arr);
var_dump($arr[1]);