I have modified your code into the following. #include<iostream> #include<iomanip> using namespace std; int main() { int number =0,...
my $str="cn=portal.090710.191533.428571000,cn=groups,dc=mp, dc=rj,dc=gov,dc=br"; if($str=~/cn=(.*),cn=/) { print $1; }
Separate names with a comma.