Jean-François MORFIN
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Good to hear it, versailles. Thanks for the points.
How about my comments about '_' and leading '-'?
How about my comments about '_' and leading '-'?
ASKER
I used the leading - filter, Thx !
_ are not permitted in DNs.
best
_ are not permitted in DNs.
best
> "I used the leading - filter, Thx !"
Does that mean that leading '-' are permitted or not?
Does that mean that leading '-' are permitted or not?
ASKER