Hi naimish,

I donīt understand your idea...

I have the following code:

if( /cn=/ )
{
$result = $_;
$result =~ s/^cn=([^,]*?),//; <-- MY REGEX EXPRESSION
}
return $result

in this case your REGEX is returning cn=groups,dc=mp,dc=rj,dc=gov,dc=br
I need the opposite result.

I think a REGEX where in the first time remove the string cn=
so the result string will be
portal.090710.191533.428571000,cn=groups,dc=mp,dc= rj,dc=gov,dc=br

The second REGEX will remove the entire string cn=groups,dc=mp,dc=rj,dc=gov,dc=br

To be lefting only the needed string portal.090710.191533.428571000

Can you help me?
Regards
Pierre