Regular Expressions 101

LDAP URI regex

Open Workspace
  • PCRE2 (PHP)
  • Match
0

Regular Expression

/
^(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