The '*' is greedy, matching as much as it can. To make it non-greedy, put a question mark after it.
if ($test =~ "LDAP://CN=(.*?),.*") {
non-Perl: Andy Ford
In reply to Re: Newbie Regex Problem
by andyford
in thread Newbie Regex Problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |