use strict;
my $str = 'Hermoso departamento 3 ambientes al frente , muy luminoso con vista panoramica . Cocina integrada , baño completo , balcon aterrazado vidriado con cerramientos 3e. Agua caliente central , Abl: $ 276.-A 1 cuadra de Av. Rivadavia al 2600 y a 2 de Av. Pueyrredon , Subte A , Trenes , Ramales de Colectivos. A 2 cuadras del Shopping Spinetto. A pocas cuadras del Congreso de la Nación. .Información Adicional: Monto de las expensas: 1900Gas naturalGas naturalCaracterísticas y servicios del edificio: Agua corrienteElectricidadGas natural
ID: 221464 ultima planta';
my $regex = qr/(\d{1,2}(\°|er|do|to|mo|vo|no|ro|ra|da|ta|ma|va|na|)\s?(piso|planta)|planta baja|primer piso|segundo piso|tercer piso|cuarto piso|quinto piso|sexto piso|s[ée]ptimo piso|[úu]ltim[oa] (piso|planta))/mip;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html