regex - How do I properly match Regular Expressions? -


I have a list of outputs from ldapsearch :

  DN: CN = HPtter, O = Student, O = Hogwarts, O = School DN: CN = HGRA, O = Student, O = Hogwarts, O = School DN: CN = RAVES, or = students, ou = Hogwarts, O = School DN: CN = DMAD, O = Student, O = Hogwarts, O = School DN: CN = SSNAPE, OU = FAQULTY, OUO = Hogwarts, O = School DN: CN = Admle , O = FC, OU = So far, I have the following Reggae:  
  / \ bcn = \ w *, / g   code>  

which removes results like this:

  cn = hobotter, cn = hganger, cn = rwesal, cn = DMALFOY, cn = SSNAPE, cn = ADUMBLED,  

I need a regex that results in such a way:

  HPtter HGRR Riversly DMALFOY SSNAP Edible  
< P> Why do I need to convert to my regex so that the pattern ( cn = and comma) is not included in the results go?

Edit: I'm using sed to match the pattern, and piping the output to other command line utilities.

Simple parsing problem and regex not an ANLR grammar will not sort it at any time.


Comments