in reply to Regular Expression Help
If your data is exactly have it there then:
will work fine. Of course if the data changes format in the slightest it will probably breaklocal $/ = ''; + while (<DATA>) { chomp; + my( $group, $number, $members) = split /,/,$_,3; + @members = ($members =~ /(CN=[^,]+)/mg); + $members = '"' . join( ',', @members) . '"'; + print "$group,$number,$members\n"; + } __DATA__ ...
PS Please do not keep posting new threads when you have a followup to a previously posted question.
/J\
|
|---|