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

In reply to Regex for AD Organizational Units by jzelkowsz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.