Comments (3)
Thanks for spotting this!
from template-library-core.
A quick look through the net has yielded this:
(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}\.?$)
which isn't perfect but I think it's better.
It uses negative lookaheads and lookbehinds to make sure no label starts or ends with a -
, enforces a minimum of two labels, the last of which should be at least two characters long (no currently accepted TLDs have fewer than two characters) and will accept a trailing dot (for the root domain).
Caveats I can immediately see:
- If there is a trailing dot and the rest is still 253 characters it will match but the FQDN will be longer than 255 octets and thus non-conformant to the standard.
- It won't match FQDNs like
example.
which could be valid directly under the root domain (although highly likely to ever be used).
from template-library-core.
@gvasilak could you open a PR to update the regexp?
from template-library-core.
Related Issues (20)
- add absolute_path type
- Change type legacy_binary_affirmation_string to legacy_yes_or_no_string HOT 3
- Add /system/vm in the tree HOT 4
- add valid_interface type HOT 2
- functions/package: change values for PKG_VERSION_xxx constants HOT 1
- Missing AII freeipa templates
- What is oldnames intended for? HOT 1
- quattor/functions/network: boot_nic returns last, not first boot device
- remove get_subnet_params from quattor/functions/network HOT 3
- update partition flags HOT 2
- component authconfig : krb5_realm = ARRAY(0x39a5830) HOT 1
- component authconfig : There is no "use_object_class" in the sssd configuration HOT 1
- Consider validation of '/system/archetype/os/name' HOT 5
- Revert os and model fields structure archetype to Aquilon standard HOT 3
- Aquilon schema cleanup HOT 1
- 18.6.0: linux_capability type regexp incorrect
- types: aquilon: add new structure_entitlements in the system parameters
- at some point the in the future, remove the blockdevices_tmpfs_type type HOT 1
- opennebula: ds_mad can't be set for a system datastore
- schema ntpd_tinker_options/step should be "double", not "long"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from template-library-core.