PERL regular expression

Hello all,

I need to match the red expressions in the following lines :
MACRO_P+P-_scrambledServices_REM_PRC30.xml
MACRO_P+P-_scrambledServices_REM_RS636.xml
MACRO_P+P-_scrambledServices_REM_RS535.xml
and so on...
Can anyone give me a PERL regular expression to match those characters ?

Cheers,
Ludo

/MACRO_P\+P-_scrambledServices_REM_([A-Z]{2,3}\d{2,3})\.xml/

Unless there are other constraints you didn't tell us about.

This may help you !

while(<>)  {
    $_ =~ s/.*_(.*?).xml/$1/;
    print $_;
}

Thanks for the reply !
Actually the expression is more like that :
MACRO_someCharacters_REM_otherCharacters.xml
and I need to match otherCharacters only. Perhaps is there a way to match characters that are behind _REM_ ?

Cheers

perl -ne '{print $1,"\n" if /(?<=_)([^_]*)(?=.xml)/;}'

Thank you, this line works perfectly !!