Validate a domain name or ip addres using regex

this is the code I use but I can't set EXP2 to limit the number under the 256. Does anybody help?
P.S.
EXP1 validate a domain name (es. www.myserver.com)
EXP2 may validate IP address (es. 111.111.111.0)
public static boolean isServerAddress(String s){
    System.out.print(s + " ");     
    String EXP1 ="([a-zA-Z0-9]+).([a-zA-Z0-9]+).([a-zA-Z]{2,3})|([a-zA-Z0-9]+).([a-zA-Z0-9]+).([a-zA-Z]{2,3}).([a-zA-Z]{2,3}+)";
    String EXP2 ="([0-9]{1,3}+).([0-9]{1,3}+).([0-9]{1,3}+).([0-9]{1,3})";
    if(Pattern.matches(EXP1, s)){
      return true;
    }else if(Pattern.matches(EXP2, s)){
      return true;
    }else{
      return false;
  }

This regex should work for your.
Make sure you look at it and understand why it works. Also, you use '.' in your regular expressions. A period will match any character, yso you must escape your periods if you want to match the period character.
String BYTE_EXP = "(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])";
String EXP2 = BYTE_EXP + "\\." + BYTE_EXP + "\\." + BYTE_EXP + "\\." + BYTE_EXP;

Similar Messages

  • This domain name can't be used because it contains a protected word or inappropriate language.

    Dear
    Creating a Microsoft services experience for my domain (fazlic.ba), is showing an error message as below:
    "This domain name can't be used because it contains a protected word or inappropriate language. Please contact support if you feel this is not the case."
    Can somone help in resolving this issue as i need this bit urgent and i am trying for same since last 2 days but with no success
    My domain name is fazlic.ba, which needs to be added as custom domain in domain.live.com
    Thanks

    Hi,
    we cannot provide any solution here because the domain validation is the second step of the process and is automated.
    My advice wouldbe to follow the message guideline and contact the support, they may identify why this domain is refused.
    Hope this helps,
    Fabrice DI GIULIO, http://blog.digiulio.fr
    Technical Solutions Professional, EMEA at AvePoint

  • This domain name can't be used because it contains a protected word or inappropriate language. Please contact support if you feel this is not the case.

    we are unable to domain smippl.com it gives error
    This domain name can't be used because it contains a protected word or inappropriate language. Please contact support if you feel this is not the case.
    It is a real estate company :
    SARLA MADAN INFRASTRUCTURE PROJECTS PRIVATE LIMITED
          Address : "SWAYANG TOWER" (STILT FLOOR),
          Plot No. M-73, Madhusudan Nagar, Unit-IV, Bhubaneswar-751001, Odisha,
          India
    current email : [email protected]
    Domain to setup email in Windows Live outlook express  - smippl.com
    waiting for solution

    Hi,
    I wonder if you are registering domain name here:
    https://domains.live.com/Signup/SignupDomain.aspx?dn=&ss=0&ctkn=&et=0
    If so contact with windows live support:
    https://support.live.com/default.aspx?scrx=1
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to configure internet domain name for P6 website using weblogic

    After installing and configuring weblogic for P6 you get the following address https://servername:7002/console/login/LoginForm.jsp to access P6 website.  Anyone know how to configure a purchase domain such as www.mydomain.com have it redirect to https://servername:7002/console/login/LoginForm.jsp Is this configured in weblogic server? If not, what is needed to redirect the purchased domain?

    HI
    You could have that domain resolving to/by some DNS servers and set up a load balancer / proxy to redirect every incoming request to that domain / site to your weblogic console.
    however , what is it you are trying to do? It is very unsual of redirecting/ using Domain names to redirect to wls consoles.
    could you explain your use case in detail please
    Sri

  • Muse can't validate my domain name, FTP and folder....? when I try to upload it to Host FTP

    When I try to publish my additions in Muse, an error message tells me that it can't validate my domain, FTP and server folder. Has anyone had this problem?

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it, which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • Using a domain name with the mac site

    If I use a domain name on Site #2, does that mean that Site #1 will automatically have the same domain name?
    I already have a Site #1 up and running. Now I purchased a new domain name that I would like to use only for site# 2. I was worried about going in with any edits to Site #1 just in case it would go to the new domain name instead of where it is right now.
    Any light on that subject?

    If you have 2 websites in the same domain folder the uppermost site or the site that you most recently published will be linked to your domain name. If you don't want it to be then you need to re-publish with the site that you want to be linked to your domain name is uppermost. You can move the sites around by dropping and dragging.
    The easiest thing to do is to separate the sites so that you have site 1 in 1 folder and site 2 in another. Following this, the site that you publish first will be linked to your domain name. If it is not this site that you want then just publish the other site.
    How do you have the first site set up? Is it using CNAME or web forwarding? Have you entered your personal domain name into your .Mac account?
    If you have one .Mac account and two websites and two personal domain names, then you can use CNAME for one site and web forwarding with or without masking for the other site. You can only enter one domain name into one .Mac account.

  • Using Multiple Domain Names to Access Our Portal

    We operate one domain corp.company.com but all internal intranet web servers get  assigned the address inside.ZZZ. The inside.ZZZ is on our IE exclusion list but company.com is not. Adding company.com seems to be a miserable task so we are looking at adding an alias so our users can access the server at the new inside.ZZZ url. We have DNS pointing the URL to the right server and that seems to be working properly.
    Something within the application is redirecting the page to gnwhepdev.corp. company .com (our server’s domain address) after the initial login.  Since *.corp. company .com is not in the exclusion list, it is considered an outside address and rerouted.  We are trying to find some way to pass the alias within the  application itself so that we don’t need *.corp. company .com in the exclusion list and we can point users to the inside.ZZZ url.
    Our team researched this issue and found documentation that supported the use of multiple domain names to access a Enterprise Portal.  The documentation that we found is below:
    How To…Configure the J2EE Engine Deployment Descriptor (Version 1.00 – July 2004)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0eb8120-b66c-2910-5795-894f384fc054
    Particularly on page 13-15 in the documentation it talks about enabling the portal via multiple domain names (Section 3.7:  Using Multiple Domain Names to Access the Portal).  Also, the documentation says the following:
         You must have sever proxy servers, each with a different domain name.  You then activate the filter mechanism and configure it to work with several proxy servers
    We have several questions about the possiblities of being able to set this up and whether it would require another server where Web Dispatcher would need to be installed for this configuration to work properly.  Can someone please provide some insight into what needs to be configured and answer the question about the Web Dispatcher?  Also, if Web Dispatcher is required, what steps need to be done to configure?  If Web Dispatcher is not needed, what will we need to do apart from that to set this up for our Enterprise Portal system?

    It is but you have to use masking......
    http://iwebfaq.org/site/iWeb_Domains.html

  • Custom Domain name for Azure virtual machine using azure websites

    Hie, I am using a cloud service (e.g cloud1) and it has a hosted VM in it (Windows server 2012). It is having a URL cloud1.cloudapp.net. So I want to use the domain name (e.g azuresite1.azurewebsites.net)created from azure.
      So how do I add the Cname record and everything in this setup .
      I already tried to use
    this but that didn't work
     What additional steps are required to add custom domain name to an azure virtual machine and, the custom domain name is also an azure website

    If you want to use azuresite1.zurewebsites.net then i think, you have to create a azurewebsite. If you have a custom domain then following should work.
    You have findout the IP that is attached to the VM. 
    Point your domain name to that IP (using domain dashboard)
    Now your domain points to whatever the site hosted on the VM (port 80)
    If you have more sites then, you have specify HostName for the site which you want to use with domain name.
    Try and let me know if this helped.

  • Can you host multiple domain names on mobile me with iWeb '09?

    Hi
    Can anyone help, before I upgrade to iLife '09, I have a personal web domain name which I host on my mobileme account. My girlfriend now wants a website and I have bought her a domain name and want to use iWeb to design it but I can't seem to host multiple domains on iWeb '08, can you with iLife '09? Or will she have to buy her own mobile me account? Any help will be great!!!
    Thanks

    MobileMe -MME -is Apple's hosting service.
    Domain Name System - DNS translates an understandable address like www.mywebsite.com into the IP address which is a number like 40:75:92:301.
    Cname is a name of record in a database that records what domain name goes to what IP address.
    IP address is just a unique number that identifies any device connected to the internet.
    An FTP client is an application the uploads your files to a server using File Transfer Protocol.
    I mainly use Web Site Maestro because it doesn't just upload the files but optimizes them first to remove all the unnecessary code that iWeb creates to allow your website to download at least 30% faster.
    I also use Yummy FTP for sorting out and keeping track of my files on the server and uploading folders of images and music files along with their assets for flash presentations.
    I have used Host Excellence for years because of the way they allow you to name your own root folder on the server and also their great tech support.
    FTP and servers can be a bit confusing but, if you have a good hosting company, you can get by on very little knowledge and understanding. I do!
    I couldn't agree more with you about the acronyms and jargon. The more people use them usually means the less they know. One of the most misused words is "domain". I tried to sort that one out here...
    http://www.iwebformusicians.com/SearchEngines/Upload.html
    Now I'm going FUH and ATNP.

  • Domain Names and Oracle

    Hi,
    I am preparing to install Oracle 8i on my Windows NT machine,
    and I stumped into something that I can find no answer for.
    Oracle asks me to say what my domain name is (e.g. suse.com). It
    uses this to manage the different Oracle instances, e.g.,
    server1.suse.com and server2.suse.com. Well, the problem is that
    our machines do not have our domain name. That is, the machine I
    am using (as well as all our servers) does not have a DNS name
    xxx.intelsystech.com. Their names are managed by our ISP, and
    for all I know they change it once in a while. Our machines do
    have unique IP numbers, though (e.g. 43.25.44.32). We have
    managed to do just about everything else using these fixed IP
    numbers (e.g. ftp, http, etc.). Also, names are not a problem
    because all machines are in the Windows Active Directory domain,
    and therefore have a "local" name (e.g. Monet) in the Windows
    LAN.
    What should I enter when Oracle asks for my domain name? And for
    the machine name? Can I use the IP number? Or the IP pattern
    (e.g. 43.25.44.)? How will I be able to refer to an Oracle
    service (listener, database name) without a domain name?
    Thanks,
    Taha

    Oracle asks me to say what my domain name is (e.g. suse.com). It
    uses this to manage the different Oracle instances, e.g.,
    server1.suse.com and server2.suse.com. These domain names are not the same as ip domain names. You need
    the domain names only if you want to have different oracle db's
    connected to each other, e.g. for replication.
    If you are using this db alone, then just choose any name.
    How will I be able to refer to an Oracle
    service (listener, database name) without a domain name? You can use ip-addresses for listener and tnsnames, but it is
    better to use dns-names.
    Hop this helps.
    Thomas

  • How do I transfert my domain name from the first registrar to business catalyst ?

    Hey,
    I don't find where (on the Admin Console) I have to put the EEP Key of my domain name I want to use for the website on BC. This EPP Key  come from the registrar of my  site that I want to transfer to BC. I want use this name domain.
    Can you help me ?
    Thank you.
    Marion

    Hi Marion,
    After you have gone live with your BC site you'll need to access your domain's registrar and input our NS records. 
    So you'll need go where you purchased the domain to set this up.  Please view the article below for step by step instructions.
    - http://helpx.adobe.com/business-catalyst/using/change-site-domain.html
    Kind regards,
    -Sidney

  • Domain name and iweb - masking url?

    i have a domain name and want to use it for my website i created on iweb - is there a way to mask the url so when people type in my domain name they are directed to my iweb site??
    thanks

    Just go to the whatever place has your domain name and ask them or search in their FAQ or Help for how to do Domain Forwarding and Masking.

  • Looking for the most econmical way of tying domain name to mobileme iweb

    Hi all, I currently have a few sites that are hosted on mobileme, and I used the DynDNS services to 1) register a domain name (15$) and 2) create a webhop (CNAME) from the domain to the mobileme site (30$). So that's 45$ per year per site. Is there a more economical way of doing the same thing (without running my own server)? I have a handful of brochure sites to post, and I am looking to cut costs. Thx!!!
    coocoo

    No. Look at GoDaddy and see and I think that you will find that what OT has said is correct.
    If you purchase a domain name from them, depending on what ending it is - .com, .co.uk, .net etc, then you just pay for the cost of the registration for one year or two years, which does work out at $7.95 per YEAR depending on the domain name you get and this will be excluding any hosting or e-mail packages. E-mail does cost extra though.
    If you just register your domain name, then you can use CNAME forwarding or web forwarding at no extra cost. So none of this adding $29 for the privilege of using CNAME forwarding - GoDaddy does not do this and you get it when you register your domain name.
    Once you have the domain name registered, all you do is set up a new CNAME and point the 'www' part of your domain to web.me.com which is your MobileMe host and it will be forwarded to your site.
    I use GoDaddy myself and have no problems whatsoever.
    If you have one MobileMe account, then you have the option of entering a domain name into the Personal Domain Name settings - you can do this once for every MobileMe account and can then use CNAME forwarding at your domain registrar to forward your domain name to your MobileMe account.
    However, you can still publish as many sites as you like to MobileMe, but your url will be http://web.me.com/username/sitename, unless you then use masked or unmasked web forwarding to link your domain name to it if you wish.

  • How to get localcomputer network  domain name?

    HI all
       Does any one know how to get  localcomputer's network domain name !  I call use function to get  local computername in sap system! But I could not find any functions to get network domain !

    Below link may be useful, check reply from Poornanand.
    Get user system domain name ?

  • Installation of Sun Directory Server on Home PC - Domain name problem

    Hi!
    I would like to install SunONE directory server on my home PC but, I am unable to do so because one of the installation steps requires the fully qualified machine name. This is of format <hostname>.<domainname>. My home PC doesnot belong to any domain. Is there any solution to this problem? Is there a default domain name that I can use?
    Thanks in advance!

    Hi,
    This post talks about that problem:
    http://forum.java.sun.com/thread.jspa?threadID=5111917&tstart=0
    Rob.

Maybe you are looking for

  • How to create a dynamic radiobutton in webdynpro dynamically

    HI, I want to create radiobutton in webdynpro dynamically.But this button in not enabled.Code:-      IWDNodeInfo info =wdContext.getNodeInfo().addChild("RadioBUttonDymanicNode",null,true,false,true,false,false,true,null,null,null);      IWDRadioButto

  • Req. delivery date and Delivery date should be same in a sales order

    Hi experts, We need a customization for getting Requested delivery date, Material Availability date and Delivery date should be same. Example if I keep request delivery date as 12/12/2012, system should consider same dates for MAD and Delivery and co

  • How to Enable the Oracle BPM Worklist?

    Hi! Newbie here. So how do you enable the Oracle BPM Worklist? Sure there a tutorial for this found in http://docs.oracle.com/cd/E21764_01/doc.1111/e17366/chapter16.htm#BABHCICI and in section "16.2 How to Enable the Oracle BPM Worklist" it says "By

  • Help on config 1:n multi-map

    Hi, guru I refered https://weblogs.sdn.sap.com/pub/wlg/3115. [original link is broken] [original link is broken] [original link is broken] In PI7.1 ESB, Now I created 1:n message mapping and Operation Mapping. I think next step is to create a Integra

  • Home hub 2 acting up

    Ok so I recently changed from wpa and wpa 2 to wep . But then I changed back to wpa and wpa2 however. Every hour our so the router stops working so I go downstairs and look but all lights are blue(so fine). So I go back upstairs to my mac and try to