Pattern Match doesnt work help

Does this code look ok below? trying to match it all in one string
public String getEmail(){
//Checks for email addresses making sure it contains
//the @ symbol, .net .com and .edu.
Pattern p = Pattern.compile("/^\w+((-\w++)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[net,edu,com]+$/");
Matcher m = p.matcher(email);
if (m.find())
System.err.println("Email must contain an, @ symbol and end in .net,.edu or .com"+.");
else {
     return "";
}

This will get you most of the way there:
       Pattern p = Pattern.compile(".+@[A-Za-z0-9\\-_]+(.com|.net|.edu)$");
       Matcher m = p.matcher(email);
       if (m.find()) { System.out.println("Match - Email Address OK"); }
       else { System.out.println("No Match -  Email Address Bad"); }

Similar Messages

  • I was charging my iphone 3GS yesterday in electricity when once it turned off suddenly while it was in quarter battery. I tried charging it again but it didint open, i tried to plug it into my laptop but itunes didnt recognize it and it doesnt work. help

    i was charging my iphone 3GS yesterday in electricity when once it turned off suddenly while it was in quarter battery. I tried charging it again but it didint open, i tried to plug it into my laptop but itunes didnt recognize it and it doesnt work. help plzzz

    Hello candymerna,
    At this point I would recommeng resetting the device if if will not turn on.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    From: iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
              http://support.apple.com/kb/ht1430
    If it does turn on, but will not charge then take a look at this part of the article iPhone: Hardware troubleshooting found http://support.apple.com/kb/ts2802
    Power/Battery
    Battery does not charge from the USB power adapter
    Important: Only original iPhone can be charged from a FireWire-based power source. If iPhone is connected to a computer that's turned off or is in sleep or standby mode, the battery may drain.
    Verify that the outlet being used is working.
    Try another USB power adapter if available.
    If no other USB power adapter is available, try connecting to a high-power USB 2.0 port (not a keyboard). The computer must be turned on and not in sleep or standby mode.
    Try another USB cable if available.
    Also refer to iPhone and iPod touch: Charging the battery.
    If it is charging, but not recognized in iTunes take a look at one of these articles depending on your Operating System.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    or
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/ts1591
    Cheers,
    Sterling

  • TS1702 I tunes Match doesnt work on my IOS devices. It states I'm not subscribed

    I tunes Match doesnt work on my IOS devices. It states I'm not subscribed

    On the other device setup an other email address; Settings > Messages > Receive on.

  • I cant connect my i phone 4 to my sony vaio laptop via bluetooth  i am  having problem can any one help me how can i connect my i phone 4 to my laptop using bluetooth i tried to paired but it just doesnt work help me pls!!

    i cant connect my i phone 4 to my sony vaio laptop via bluetooth  i am  having problem can any one help me how can i connect my i phone 4 to my laptop using bluetooth i tried to paired but it just doesnt work help me pls!!

    Unless you're trying to tether your phone to your computer or create a personal hotspot, it won't pair with your computer by bluetooth. File transfer by bluetooth is not supported. So, you can quit trying unless you're trying to tether.

  • Pattern generation doesnt work - DIOHS96

    Hello
    I have a trouble getting the DAQmx to do a pattern generation as expected.
    the first mode of operation, is when i set the clock configuration to "sample clock": the card should support 2MHz operation, however, above about 2KHz, the card spits out everything BUT the last 16 samples! . the error i get is underbuffer, when i force the task to stop after having waited too long. above 1MHz the output operation dies in the middle, underbuffer error.
    to note, i monitor all the time the data written to buffer, and the actual nb of samples generated. i see that i have written a nb of samples, that the memory has filled, that it recovers as the data is spit out, and that suddenly, 16 bits from the end it stops.
    the second mode of operation, is by setting the clock configuration to " burst (input)", after the recommendation of Johannes from this same forum (by the way, i still want to understand why first mode of operation doesnt work). then, on most computers installed with same card the system works nicely, and i get 2MHz operation working.
    But for one computer: a new HP, which had a bug already not recognising the NI card first, but after the bug fix from knowledgebase it recognised it. it seems this card work using traditional DAQ now on this specific computer.
    What happens on this computer is that the "sample clock" configuration works as on any other computer, meaning badly. and the "burst input" mode, doesnt work at all. it spits out only the first 16 samples, then dies. i have to stop the task manually.
    so you can check that i make no mistake, i attach my piece of code that does the work.
    Hope that i get help fast! thanks
    OOPS! this should have gone to hardware board! - disregard!
    Message Edited by Gabi1 on 05-10-2007 04:56 AM
    ... And here's where I keep assorted lengths of wires...

    This will get you most of the way there:
           Pattern p = Pattern.compile(".+@[A-Za-z0-9\\-_]+(.com|.net|.edu)$");
           Matcher m = p.matcher(email);
           if (m.find()) { System.out.println("Match - Email Address OK"); }
           else { System.out.println("No Match -  Email Address Bad"); }

  • My phone went blank and now will only show the apple logo I have tried to reset it and that doesnt work HELP!!!!

    My iPhone is frozen. It was working find about a hour ago and then for no reason the screen went to the apple logo. I have tried to reset it and that doesnt work. When I press the power/lock button and the center key it turns off but then it comes right back to the apple logo screen and wont go any further. Please help I dont have my stuff saved and would like to keep the stuff i do have on it!!! Every once in awhile the screen will go black for a few seconds then the apple logo pops right back up! I dont know what to do.....

    Try to set it up as new device, explained here:
    How to back up your data and set up as a new device
    First without using the backup, in case it contains corrupt data.
    If it works after that, use the backup to restore from.

  • I droped my z10 in the water screen touch doesnt work HELP!

    I accedently dropped my z10 in the toilet. I put it in rice for 3 days. the screen turns on and you can see everything on there but when i try swiping to unlocking it or answering calls where the calling swipe appears the touch swipe doesnt work on that part so it wont allow me to answer calls of unlock? what should i do? Please help I love my z10!

    More time in the rice.
    1. Remove the battery immediately!! Do not attempt to turn on your BlackBerry.
    2. Let the device dry in a warm, dry place for 3 to 5 days* (see below)
    3. DO NOT "check it each day" by placing the battery in. Leave it be to dry completely. This takes time. Replacing the battery to check it can only damage it more (moisture + electrical current = disaster).
    4. If the device is warm after the drying period, allow it to cool to room temperature before placing the battery back in.
    Suggestions on drying your BlackBerry in a warm place (open, with the battery out):
    *Place the BB in a container of dry UNcooked rice, and then you might also place it in any of the locations mentioned below.
    *On top of any dry heat emitting electronic component: TV cabinet or CRT, LCD, cable TV/Satellite converter box or plasma monitor
    *On the dashboard of your car on a sunny day
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • People Cannot Hear Me When I make Calls on iPhone 4, Bought a new iPhone 4, uploaded all of my own information from the backup, and it still doesnt work, help!

    I went in to apple, they couldnt figure it out, I am on AT&T so I was figuring on going into their store today and seeing if its something with the network, if not I am going back to apple, but this is literally a brand new phone i bought yesterday, not refurbished or anything, brand new, does anyone know why this isnt working? Everything else works fine, the mics both work, its just when I make calls or someone calls me the mic doesnt work.

    When you see the same issue on more than one hardware device, it means that the problem is likely to exist outside of the hardware.  Two things to investigate would be the software/firmware on the backup and issues with the cellular network.  It's probably safe to rule out the cellular network as well.
    First, make sure that you have imported copies of all the information (pictures, videos, documents) on the device.  Do this thorough itunes, and the applications (photographic and document processing) on your computer.  Perform a firmware update then restore the device as new.  If the problem persists, then you may actually have the worst luck and discovered two devices with an identical issue.
    Read each of the steps before initiating the DFU.
    !.  Connect the iPhone to any computer running a fully updated version of iTunes.
    2. Press and hold both "home" and "sleep/wake" buttons
    3. After eight seconds let go of only the sleep/wake button.
    4. Keep holding the home button until you see a popup mesage in iTunes.
    5. Read all all the popups, then use iTunes to update the iPhone's software.
    If the popup fails to show, repeat steps 2 through 4

  • Indesign CS6 crashed, can't be started again (missing required fonts, cmap files). Reinstalled -- doesnt work. help?

    hi,
    my indesign CS6 worked perfectly until yesterday afternoon, when it suddenly crashed and wont open again. all it says is "There are required system fonts or cmap files missing. reinstall indesign". Did that, with the cc cleaner, but that doesnt work!
    working on windows 7, sp1 -- never had any problems.
    all i can find in other forums is about the cs2, which is fairly outdated. why does this happen?! all my other programs from the master collection work fine!

    ok, after a quite frustrating weekend the problem seems to have solved itself. what i did (for future requests):
    - downloaded cs6 master collection (since i had my cds not with me)
    - deinstalled old install
    - wiped the system with the adobe cc cleaner tool to get everything off
    - restart
    - install cs6
    - same error. no chance of doing anything.
    i then installed a trial version on another computer to at least render my pdf. i then tried something new: i put the cmap & fonts (in C:/Programs/Common Files/Adobe/PDFL) from the working pc on a usb drive. when i "backed up" my PDFL Folder on my main pc into a zip (just in case), i gave indesign another try. it then started up -- since it was the first time a bit slower than usual, but it's back on track.

  • Slider doesnt work. help pls!

    Slider doesnt work. Cannot unlock screen and cannot shut it down. Tried rebooting it but doesnt respond either.

    Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • My wifi doesnt work help

    wi fi on iphone 4s doesnt work help

    That's unfortunate.
    Try a search of the forums for troubleshooting steps.

  • IPhoto doesnt work, Help!

    I upgraded a long time from iPhoto 5 to 6 and didnt work i had come here for help and posted a thread but because its to old wont allow me to reply. My problem is that when i open iPhoto it keeps saying "loading the photos" but nothing works and suddenlly it crashes. Please some help.
    Thanks a lot
    F.
    In order to quit the program i have to force quited from finder
    This is the link to the old thread:
    http://discussions.apple.com/thread.jspa?threadID=998643&tstart=0

    try rebuilding the library - launch iPhoto while depressing the option (alt) and command (apple) keys - select all options
    If that does not work download iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ - and use its rebuild function
    If neither of these work then you will have to create a new library - quit iPhoto, drag the iPhoto library to the desktop, launch iPhoto and create a new library and open the iphoto library on your desktop and open the originals folder and drag each folder in it to the iPhoto icon in the dock
    LN

  • Had to rebuild PC and now AE doesnt work - HELP!

    My PC got all hogged-up with spyware and I had to rebuild. Now nothing works.
    Currently, my PC connects via ethernet to a Linksys router w/ phone ports (vonage box), then to a Linksys 4-pt wireless router, then to the cable modem. I also have a laptop which connects to the wireless router for Internet, which is working fine.
    Its been a while since I originally set this up, so maybe Im doing somthing dumb? I plugged AE into stereo, re-set to factory defaults and plugged it in (currently blinking amber). I installed the AirPort Utility on my PC, and it just comes back saying "unable to find any airport base stations".
    I did also remove a wireless PCI card from the PC, but Im not sure it even worked and dont think it was being used in my scenario???
    Ive restored the AE to factory default and uninstalled, and reinstalled Airport Utility several times. Not sure what to try next... any help?

    If i have learnt anything about Apple its this.
    Never, ever, ever, ever upgrade to anything until it is verging on obsolete. This way you can have stuff that works and let the upgraders have the grief of ironing out the bugs.
    Also i have noticed Apple never say anything but 'versions' keep appearing that will hopefully fix your problem/other's problems. 7.7.1 fixd my Touch and as far as i am concerned that is it for me with upgrades.
    They can keep the 2.0 i am afraid. £10 to turn a £300 machine into a high tech brick...no thanks.
    Hope you get everything sorted anyway.
    asp

  • Ipod touch wont turn on, holding buttons doesnt work, HELP!!

    So last night, I went to bed setting my iPod next to me on the floor. I wake up this morning, and it will not respond to anything I press. I charged it for an hour, I held the power button, home button, both, for over a minute each. I need help... I don't know if I can send it in with a warranty being valid, I got it as a present used for Christmas. I'm so angry at Apple, it seems like this is a common problem, but everyone else's operates after holding the buttons. It is an iPod Touch, 4th gen, 32 gb. It doesnt connect to iTunes, it won't show up as charging, and it will not turn on or respond.

    - See if placing the iPod in Recovery mode will allow iTunes to see the iPod.
    - Next try DFU mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If you have an Apple store nearby then make an appointment at the Genus Bar of an Apple store. It is free.
    - You can check you warranty by entering the SN here:
    Apple - Support - Check Your Service and Support Coverage
    - The following provides the instructions for sending it to Apple.
    Apple - Support - iPod - Service FAQ

  • War deployment doesnt work - help

    Hi All
    We're trying to deploy our war file with weblogic.Deployer but it keeps failing.
    We need help to understand the problem to fix it.
    weblogic.Deployer invoked with options: -adminURL t3://weblogic.host.com:7001 -user weblogic -name App -source /path/to/App.war -targets App_Managed_Server -deploy
    <Jan 12, 2013 11:37:11 PM PST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, App [archive: /path/to/App.war], to App_Managed_Server .>
    Task 108 initiated: [Deployer:149026]deploy application App on App_Managed_Server.
    Task 108 failed: [Deployer:149026]deploy application App on App_Managed_Server.
    Target state: deploy failed on Server App_Managed_Server
    weblogic.management.DeploymentException: [J2EE:160177]The application at "/scratch/software/Oracle/Middleware/user_projects/domains/wl_server/servers/App_Managed_Server/stage/App/app" was not recognized as a valid application type. If this is an EAR file, please ensure the META-INF/application.xml exists. EJB-JARs should have a META-INF/ejb-jar.xml or corresponding annotations exist. If this is an exploded WAR, the name of directory must be end with ".war". RARs require a META-INF/ra.xml. A JMS deployment should be an XML file whose name ends with "-jms.xml". A JDBC deployment should be an XML file whose name ends with "-jdbc.xml". For other application types, please consult the WebLogic Server documentation.
    On another war file,
    weblogic.Deployer invoked with options: -adminURL t3://weblogic.host.com:7001 -user weblogic -name ws -source /path/to/ws.war -targets App_Managed_Server -redeploy
    <Jan 13, 2013 12:33:21 AM PST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating redeploy operation for application, ws [archive: /path/to/ws.war], to App_Managed_Server .>
    Task 124 initiated: [Deployer:149026]deploy application ws on App_Managed_Server.
    Task 124 failed: [Deployer:149026]deploy application ws on App_Managed_Server.
    Target state: redeploy failed on Server App_Managed_Server
    weblogic.application.ModuleException: Context path '/ws' is already in use by the module: ws.war application: ws
    We tried undeploying it and deploy and we get the same error
    What did we do wrong?
    Edited by: 898644 on Jan 13, 2013 12:37 AM

    They are two different problems.
    The first may be due to an incorrectly packaged ear file or by some garbage temporary files or bad WebLoigc status.
    The second may be due to some garbage temporary files or bad WebLoigc status.
    At first step try cleaning up by
    - stopping all the WebLogic server instances (admin and managed)
    - removing <domain>/servers/<server_name>/tmp , <domain>/servers/<server_name>/cache , <domain>/servers/<server_name>/stage
    - start all the WebLogic server instances (admin and managed)
    And try again.
    Bye
    Mariano

Maybe you are looking for