Regular Expressions 101

Community Patterns

LDAP URI regex

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(ldap(s)?:\/\/)(((\d{1,3}.){3}\d{1,3}(:\d+)?)|(\w|\d|)+|((\[([a-f0-9]{1,4}:{1,2}){1,4}([a-f0-9]{1,4})\])(:\d+)?)).\w+$
/
gm

Description

ldap, ldaps, ipv4, ipv6 & dns (bare bones)

Submitted by anonymous - 2 years ago