Link to home
Start Free TrialLog in
Avatar of Jean-François MORFIN
Jean-François MORFINFlag for France

asked on

Perl string filter

I have a filter in a perl script which works for a decade. I am not familiar anymore with perl. I wish to update it and I do not know how to do it.

The filter reads as:   if  ($dn !~ /^[a-zA-Z0-9\-]{3,}$/). This is to make sure a domain name string is longer than two chars and only made of letters, figures and "-". I would like to add that the first character cannot be a "0" (zero).

How is the string to read for obtaing that?
Thanks a lot
Best
ASKER CERTIFIED SOLUTION
Avatar of tel2
tel2
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jean-François MORFIN

ASKER

Thx a lot. IT works !
Good to hear it, versailles.  Thanks for the points.

How about my comments about '_' and leading '-'?
I used the leading - filter, Thx !
_ are not permitted in DNs.
best
> "I used the leading - filter, Thx !"

Does that mean that leading '-' are permitted or not?