Fixed regex not allowing subsubdomains on add server

This commit is contained in:
Juan Gilsanz Polo 2022-10-13 00:16:49 +02:00
parent f5b0648496
commit b4a68eee47

View file

@ -173,7 +173,7 @@ class _AddServerModalState extends State<AddServerModal> {
void validateAddress(String? value) {
if (value != null && value != '') {
RegExp ipAddress = RegExp(r'^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$');
RegExp domain = RegExp(r'^((?!-))(xn--)?[a-z0-9][a-z0-9-_]{0,61}[a-z0-9]{0,1}\.(xn--)?([a-z0-9\-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$');
RegExp domain = RegExp(r'^([a-z0-9|-]+\.)*[a-z0-9|-]+\.[a-z]+$');
if (ipAddress.hasMatch(value) == true || domain.hasMatch(value) == true) {
setState(() {
ipDomainError = null;