[BlueOnyx:15265] Re: AOL and DKIM, SPF & Re: SSL change after updates?

Michael Stauber mstauber at blueonyx.it
Wed Apr 23 21:09:48 -05 2014


Hi Eric,

> This page offers some suggestions:
> http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address

Hehehe ... that's the one I've been using. :-)

I needed to modify it to only allow host- and domain-names that are all
lower case. Also needed to fiddle in allowing a leading underscore
and/or using the wildcard "*" exclusively for the hostname.

I might still need to apply some tweaks, but the current working example
is this:

<typedef name="fqdn" type="re"
  data="^([a-z0-9][a-z0-9\-]*\\.)+[a-z]+$"
/>

<typedef name="fqdnPlusWildcard" type="re"

data="^(((([_a-z0-9]|[_a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[_a-z0-9][a-z0-9\-]*[a-z0-9]))|(^\\*))\\.[a-z0-9][a-z0-9\-]*([\\.][a-z0-9][a-z0-9\-]*)*$"

/>

<typedef name="hostname" type="re"

data="^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$"

/>

<typedef name="hostnamePlusWildcard" type="re"

data="(^(([_a-z0-9]|[_a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[_a-z0-9][a-z0-9\-]*[a-z0-9])$)|(^\\*$)"
/>

That seems to work OK'ish for the most part.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list