jzelkowsz has asked for the wisdom of the Perl Monks concerning the following question:
I come here seeking wisdom and the solution to a problem. My desired result is:
DC=VIP-MAIN,DC=ORG
DC=VIPM,DC=ORG
DC=VIP-MAIN,DC=ORG
DC=FISC,DC=DS,DC=PPKS,DC=COM
DC=ZAPK,DC=PRIV
DC=MINISTERED,DC=NET
I am trying to remove all characters up to the first "DC=". I am not having a good result.
Current result:
DC=DC=ORG
DC=DC=ORG
DC=DC=ORG
DC=DC=COM
DC=DC=PRIV
DC=DC=NET
I have tried a couple different solution but have no good result. I beg for some wisdom, please.
#My code: while(<DATA>) { # s/^ou\=.+DC\=/DC\=/i; s/.+?(?=DC\=)/DC\=/i; print ; } __DATA__ OU=NEW HIRES,OU=PBK,DC=VIP-MAIN,DC=ORG OU=0543 - DR. SMITH PHYSICIANS\, INC,OU=549 VPIU-PARENT - DEPT MANAGED +,DC=VIPM,DC=ORG OU=SYMPH,OU=MANAGED,DC=VIP-MAIN,DC=ORG OU=USERS,OU=MANAGED,DC=FISC,DC=DS,DC=PPKS,DC=COM OU=USERS,OU=COVE PA,OU=PEOPLE,DC=ZAPK,DC=PRIV OU=USER,OU=MANAGED,DC=MINISTERED,DC=NET
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex for AD Organizational Units
by choroba (Cardinal) on Jul 10, 2019 at 19:49 UTC | |
by jzelkowsz (Novice) on Jul 11, 2019 at 18:13 UTC | |
|
Re: Regex for AD Organizational Units
by Discipulus (Canon) on Jul 10, 2019 at 19:58 UTC | |
by jzelkowsz (Novice) on Jul 11, 2019 at 18:18 UTC |