Hola. He encontrado una solución, pero como no conozco Pascalscript, yo he usado Perl v5.18:
Lo que sale es:
Código [Seleccionar]
#!/usr/bin/perl
use v5.18; # garantizamos un buen soporte de Unicode
use utf8::all; # activamos todo el soporte para UTF-8
use re '/xu'; # las exp. reg. tendrán estas opciones, por defecto
my @tests =
( 'kill the noise - all in my head feat. awolnation (batou mix)'
, 'artist - track name feat. Mister 漢字仮--名交じり文 [usa remix]'
, 'kill th-e noise - all in my head (feat awolnation)'
, 'Dj E-nergy C-21 - My Super-hero track! featuring Dj Ass-hole (usa remix)'
, 'Dj E-nergy C-21 - My Super-hero track! (feat Dj Ass-hole)'
);
my $del1 = qr/[([]/;
my $del2 = qr/[])]/;
my $featuring = qr/
(?<d1>$del1)?
(?<featuring>feat(?:uring|[.]|) \s .+?)
(?(<d1>)$del2)
/;
my $artista = qr/(?<artista>.+?)/;
my $resto = qr/
(?<cancion>.+?) \s+
(?:$featuring \s*)?
(?<extra>$del1 .+? $del2)?
$
/;
my $titulo = qr/^ $artista \s+ - \s+ $resto $/;
for my $test (@tests) {
$test =~ /$titulo/;
say $test;
say join " ", @+{qw(artista featuring)}, '-', @+{qw(cancion extra)};
say '-' x 30;
}
Lo que sale es:
Código [Seleccionar]
kill the noise - all in my head feat. awolnation (batou mix)
kill the noise feat. awolnation - all in my head (batou mix)
------------------------------
artist - track name feat. Mister 漢字仮--名交じり文 [usa remix]
artist feat. Mister 漢字仮--名交じり文 - track name [usa remix]
------------------------------
kill th-e noise - all in my head (feat awolnation)
kill th-e noise feat awolnation - all in my head
------------------------------
Dj E-nergy C-21 - My Super-hero track! featuring Dj Ass-hole (usa remix)
Dj E-nergy C-21 featuring Dj Ass-hole - My Super-hero track! (usa remix)
------------------------------
Dj E-nergy C-21 - My Super-hero track! (feat Dj Ass-hole)
Dj E-nergy C-21 feat Dj Ass-hole - My Super-hero track!
------------------------------