Numbers and letters

is this code true if i want to check if num2
1- either 6 digits (0-9) or letters in UPPER CASE.
2- or a mixture of letters in upper case and digits (in this case there may be up
to 9 letters and digits)
if(num2.length()==6 &&(c1>='A'&& c1<='Z'||
                              c1>0 && c1<10 &&
                              c2>='A'&& c2<='Z'||
                              c2>0 && c2<10 &&
                              c3>='A'&& c3<='Z'||
                              c3>0 && c3<10 &&
                              c4>='A'&& c4<='Z'||
                              c4>0 && c4<10 &&
                              c5>='A'&& c5<='Z'||
                              c5>0 && c5<10 &&
                              c6>='A'&& c6<='Z'||
                              c6>0 && c6<10)||
               num2.length()==7 &&(c1>='A'&& c1<='Z'||
                              c1>0 && c1<10 &&
                              c2>='A'&& c2<='Z'||
                              c2>0 && c2<10 &&
                              c3>='A'&& c3<='Z'||
                              c3>0 && c3<10 &&
                              c4>='A'&& c4<='Z'||
                              c4>0 && c4<10 &&
                              c5>='A'&& c5<='Z'||
                              c5>0 && c5<10 &&
                              c6>='A'&& c6<='Z'||
                              c6>0 && c6<10 &&
                              c7>='A'&& c7<='Z'||
                              c7>0 && c7<10)||
               num2.length()==8 &&(c1>='A'&& c1<='Z'||
                              c1>0 && c1<10 &&
                              c2>='A'&& c2<='Z'||
                              c2>0 && c2<10 &&
                              c3>='A'&& c3<='Z'||
                              c3>0 && c3<10 &&
                              c4>='A'&& c4<='Z'||
                              c4>0 && c4<10 &&
                              c5>='A'&& c5<='Z'||
                              c5>0 && c5<10 &&
                              c6>='A'&& c6<='Z'||
                              c6>0 && c6<10 &&
                              c7>='A'&& c7<='Z'||
                              c7>0 && c7<10 &&
                              c8>='A'&& c8<='Z'||
                              c8>0 && c8<10)||
               num2.length()==9 &&(c1>='A'&& c1<='Z'||
                              c1>0 && c1<10 &&
                              c2>='A'&& c2<='Z'||
                              c2>0 && c2<10 &&
                              c3>='A'&& c3<='Z'||
                              c3>0 && c3<10 &&
                              c4>='A'&& c4<='Z'||
                              c4>0 && c4<10 &&
                              c5>='A'&& c5<='Z'||
                              c5>0 && c5<10 &&
                              c6>='A'&& c6<='Z'||
                              c6>0 && c6<10 &&
                              c7>='A'&& c7<='Z'||
                              c7>0 && c7<10 &&
                              c8>='A'&& c8<='Z'||
                              c8>0 && c8<10 &&
                              c9>='A'&& c9<='Z'||
                              c9>0 && c9<10)){                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

My God that is ugly.
Try something like this
if(theInput.length()==6||theInput.length==9){
   Pattern p = Pattern.compile("[0-9A-Z]+");
   Matcher m = p.matcher(theInput);
   if(m.matches()){
      //the input is a string either 6 or 9 in length containing only capital letter or numbers
look at the java.util.regex package                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Can't validate outlook on iPad - random numbers and letters don't display - only a question mark in a blue box

    If I have to validate Outlook on PC or Mac - I have no problem - the random numbers and letters display fine - but if I am requested to validate outlook before sending a mail when using my iPad, the operation fails as the test numbers and letters are not shown - only a snap blue box with a question mark.  How do I convert the box into the image of a new validation code?  Thanks in advance.

    Hello,
    The question mark means it can't find it where it was when you put it in the Dock.
    I'd get EasyFind...
    http://www.macupdate.com/info.php/id/11076
    Use it to search your whole drive for Files & Folders, case insensitive & show invisibles...
    Complete
    That will show any with that word in the name at all.

  • Boxes with numbers and letters show instead of certain images on some websites

    On yammer.com and linkedin.com, images for icons, like those that should display along the top of the screen do not display. Instead, I see a rectangle with numbers and letters. I've seen quite a few articles about the rectangles with numbers and letters that apply to characters but none involving images. I've also tried the steps in the article on troubleshooting images not displaying properly, and nothing seems to work.
    Thanks!

    Make sure that you allow pages to choose their own fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced: [X] "Allow pages to choose their own fonts, instead of my selections above"

  • Has had 2 iTunes gift cards and the scratch off strip on the back leaves us unable to read the numbers and we can not retrive anysongs without the correct numbers and letters. What can we do? Please help...

    Has had 2 iTunes gift cards and the scratch off strip on the back leaves us unable to read the numbers and we can not retrive any songs without the correct numbers and letters. What can we do? Please help...

    iTunes Store: Invalid, inactive, or illegible codes

  • Iphone slow to type numbers and letters since downloading ios7

    iphone slow to type numbers and letters since downloading ios7

    RAB7228 wrote:
    iphone slow to type numbers and letters since downloading ios7
    There have been scattered reports of this problem. First try Ralph's solution, as the easiest. Next, try clearing memory by killing processes - double-press HOME, then flick each mini-page up. If it still not fixed Settings/General/Reset - Reset All Settings has been reported to be the solution by several people. Axeman's suggestion is also a good one, but is time consuming if you have a lot of content.

  • I am trying to download iTunes on to my laptap but I keep getting a "Could not open key: UNKNOWN\Components\ with a bunch of numbers and letters following.  I have uninstalled all the iTunes programs. I changed the Regedit but I still get the error?

    I am trying to download iTunes to my laptop but I keep getting this "Could not open key: UNKNOWN\Components\ followed by a bunch of numbers and letters.  I have unistalled iTunes and all the other apple componants.  I also used followed this http://discussions.apple.com/docs/DOC-3581. But I am still getting the same "Could not open key:" error and it tells me that iTunes could not download.

    On occasion, when changing ownership or permissions has no effect on the UNKNOWN\Components\ error, the fixit from the following Microsoft document sometimes works:
    Fix problems with programs that can't be installed or uninstalled

  • I am now using the free 1 month CC trial. I got a free one year licence with a camera. I have a product key 24 characters long with numbers and letters. I can't find anywhere to put this key to activate the account? Using a PC, windows 8.

    I am now using the free 1 month CC trial. I got a free one year licence with a camera. I have a product key 24 characters long with numbers and letters. I can't find anywhere to put this key to activate the account? Using a PC, windows 8.

    Redemption Code Help
    Mylenium

  • Pop-up Menu with numbers and letters

    When using a pop up menu i only have numbers in there e.g. $50. What i want to have in there is 3hrs instead of $50 because that's what will be relevant but
    the formula sees 3hrs as $50 so the spreadsheet still works. If i add letters eg $50 = 3hrs I get the following error message
    It would be great if its could say 3hrs instead of $50  4hrs instead of $70  5 hrs instead of $80
    Hope that all makes sense and someone can help me
    Many thanks
    Danny Kirk

    Hi Danny,
    When you put a mixture of numbers and letters into a cell, Numbers treats it as a (text) string. The arithmetic operators ( +, - * and / ) work only with numbers, duration values, and Date & Time values. You are getting an error because a formula using the value placed in the cell by the pop-up menu expects a number, but you have given it a (text) string.
    You can supply the operator with the number 50, formatted as currency ( $50 ), or you can provide a duration ( 3h ). If you place the operator into a formula that can use the type of value you choose, you will not get the error message.
    There does not appear to be a linear relationship between the number of hours and the number of dollars. Unless you can specify a relations ship that can be expressed mathematically, you will need to use a lookup table to match the hour values in the pop-up's menu to the related dollar value to be returned.
    Here's a simple example. Note that "3h" (without the quotes) as used in SGIII's example above is a Duration value, "3hrs" (again without the quotes) will be interpreted by Numbers as a duration, and will be automatically reformatted to display as "3h". The dollar amount has been entered (and displayed) as a number. The Amount column on the Main table has been formatted as Currency, with the default two decimal places.
    The formula in each cell of Main::Column A is: =LOOKUP(B,Lookup :: A,Lookup :: B)
    (LOOKUP is the name of the function used. "Lookup" is the name of the table from which the information is retrieved.)
    Regards,
    Barry

  • Regular expression: numbers and letters allowed

    How can i determine best way following: input string may contain only numbers and letters, letters can be from any alphabet.
    Examples:
    '123aBc' - correct, only numbers and letters
    '123 aBc' - wrong, contains space
    '123,aBc' - wrong, contains comma
    'öäüõ' - correct, contains letters from Estonian alphabet.
    'abc' - correct, contains letters from english alphabet.
    I think i should use function "regexp_like" for that, because LIKE-operator can't do such things, correct?
    How i should write the regular expression then? I'm new to reg expressions.

    CharlesRoos wrote:
    How can i determine best way following: input string may contain only numbers and letters, letters can be from any alphabet.
    Examples:
    '123aBc' - correct, only numbers and letters
    '123 aBc' - wrong, contains space
    '123,aBc' - wrong, contains comma
    'öäüõ' - correct, contains letters from Estonian alphabet.
    'abc' - correct, contains letters from english alphabet.
    I think i should use function "regexp_like" for that, because LIKE-operator can't do such things, correct?
    How i should write the regular expression then? I'm new to reg expressions.I'm not too hot on the foreign alphabets, but something like:
    regexp_like(txt, '^[[:alpha:][:digit:]]*$')should do it I think.

  • TS1398 The WEP password to access WiFI from Time Warner is 12 numbers and letters plus 14 zeros.  Can I expand the available space in the space for entering passwords

    The WEP Password to access wifi from Time Warner cable is 12 numbers and letters followed by 14zeros.  The available space to input password is unequal to the task?  Time Warner advised to call Apple.  Any one with a suggestion on how to either 'customize' WEP or expand available password input space?  Better ideaS?

    wjosten - I was using a WEP password of greater than 13 characters with no problem.
    Mondayblues - Are you saying that you cannot set your own password for your router/modem? You should be able to access it from an ethernet connected computer and change the password to suit yourself.  If it's not more than about 4 years old, you should be able to use WPA instead of WEP, which is much more secure.  Google "time warner modem  yourmodel" to find the user manual and the URL to access the modem.

  • Chapter Numbering (combining numbers and letters)

    Is there a way to create a book with module numbering that has a number and a letter.
    For example:
    Module 9: Family Room Make-Over
    Module 9A: Selecting a Paint Color
    Module 9B: Selecting a Flooring Style
    Module 9C: Selecting Furniture
    Module 10: Kitchen Make-Over
    Module 10A: Selecting Cupboard Style
    Module 10B: Selecting a Counter Top
    I'm currently using a building block of <chapnum> that automatically numbers the modules in a book. This information also updates the footer information for the page numbers (example: 9-1, 9-2, 9-3, etc.)
    I would like to add a letter with the number as shown in the example above (9A, 9B, 9C, etc.) for some of the modules.
    What is the easiest way to do this? Is there a way to automate the book build to get the 9A, 9B, 9C for some modules?
    Any help is much appreciated.
    Dennis

    Dennis:
    I'm not really in the Help Desk business, and the advantage of posting here is that someone else might benefit from the exchange (I've often solved my own FM problems by looking at answers to other people's questions here). If the suggestion Thomas provided isn't working for you, though, I'm somewhat at a loss as to what to say: His approach is exactly what I would've suggested.
    It might be helpful to establish some parameters: I assume you're broadly familiar with FrameMaker's autonumbering properties? Just to clarify, it's the part of each line of Thomas' example that begins with
    i N:
    that matters. That label (which could be any single capital letter; there's no special significance to N), followed by a colon, followed by the building blocks for the numbers and letters, all goes in the "Autonumbering Format" field of the "Numbering" tab in the Paragraph Designer. Actually, looking back at your original post, it seems you want the word "Module" at the beginning of the heading and a colon after the number. Thus, the complete autonumbering format for the top-level heading (let's say you call that paragraph tag
    i Heading1
    ) should read:
    i N:Module\ <n+>< =0>:\t
    ...where
    i N:
    is just a label that identifies this numbering sequence (so it's possible to have more than one sequence in the same document without interference); the word "Module" and the following nonbreaking space (\[space]) are simply text that will appear in the paragraph autonumbering;
    i <n+>
    is a numerical counter that increments with each new instance of the paragraph;
    i < =0>
    (and note the space before the equals sign) is a placholder that sets the value of the second numbering position to zero, but doesn't display anything; and
    i :\t
    is the colon at the end of your autonumber and a tab character to separate the autonumber from the paragraph text (presuming you want to use a tab, that is; this could just as easily be a space or nonbreaking space).
    The autonumbering sequence for the subordinate heading (call it
    i Heading2
    ), would be similar:
    i N:Module\ <n><A+>:\t
    ...the difference being that the first counter now returns the same number as the heading above, but doesn't increment, and the second counter returns a capital alpha character whose equivalent numerical value (i.e., 1=A, 2=B, etc.) is the value of the heading above plus 1.
    Note that you could replace the first counter in both autonumbering formats with
    i <$chapnum>
    , as long as you make sure the chapter number is correctly defined for each file in your book. Either way, you'll get the following results:
    [First paragraph tagged
    i Heading1
    in book] -->
    b Module 1:
    [Heading Text]
    [Second paragraph tagged
    i Heading1
    in book] -->
    b Module 2:
    [Heading Text]
    [First paragraph tagged
    i Heading2
    under Heading1] -->
    b Module 2A:
    [Heading Text]
    [Second paragraph tagged
    i Heading2
    under Heading1] -->
    b Module 2B:
    [Heading Text]
    ...and so on. Once you've set it up this way, the building block
    i <$paranum[Paragraph Tag]>
    will return the whole autonumbering string, including text and punctuation, and
    i <$paranumonly[Paragraph Tag]>
    will return only the values of the counters.
    So a cross-reference format for referencing these headings by number and heading text might look like:
    i <$paranum>\ <emphasis><$paratext><Default ¶ Font>\
    ...and would show up in text as "...this topic is discussed in more detail in
    b Module 2A:
    i Framistat Synchronization
    in the next chapter."
    To get page numbering at the Heading2 level, you would define one of the user-definable header/footer variables (e.g.,
    i Running H/F 3
    ) as:
    i <$paranumonly[Heading2]>
    ...and then include that variable in a header or footer on your masterpage:
    i Running H/F 3-<$curpagenum>
    (note that the page number building block will show up as
    i #
    when you insert it). As I said before, you can (AFAIK) only restart the page numbering to 1 at the beginning of a new file, so you'll have to divide the book into files at the same outline level at which you want to page number.
    Hope this makes it all clear and specific; if this still doesn't work for you, you'll need a better guru than me to take this further.
    -Bill

  • New user. cannot input start up code because keyboard will only let me use numbers only.  Since the code requires both numbers and letters, I'm not able to complete the code and install the program

    I need to do the finial step to activate elements 12. For some reason my keyboard will not allow me to print letters, only numbers. Since the code that is required for the final step requires both numbers and letters I'm not able to complete .

    If the code has letters it's not a serial number, but  a redemption code that you use to get a serial number:
    Redemption Code Help

  • Where is the redemption code located on elements 13? The numbers and letters i entered come up invalid

    Where is the redemption code located on product elements 13. There are numbers and characters on the box and on the cd sleeve.

    Or even in a prepaid card as per this picture:
    Click on the image and get the necessary instructions how to redeem it to get proper serial number.

  • MYWAY articles displayed as numbers and letters

    Recently out of the blue my MYWAY homepage articles started appearing as underlined numbers with a few letters, instead of news headlines.  This only happens in Safari.  I have OS 10.7.3 and the latest version of Safari.  I uninstalled, and reinstalled Safari to no avail.  I have used myway as a homepage for years and want to continue to.  Any suggestions would be appreciated.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • I have an itunes gift card for $25 and I accidentally scratched it off too hard and i cannot read the numbers and letters

    It says to scratch off the gray part on the back with a nickel, so I did. When I was scratching it off, I must of scratched too hard because I cannot read the first 5 letters and numbers...any suggestions?? Please HELP!
    Thanks!

    iTunes Store: Invalid, inactive, or illegible codes

Maybe you are looking for

  • No wifi since update last week on 4s

    Since the last update my wifi is completely greyed out so can't select a network. Have tried apple's fix, which worked for all of 20mins. Any other suggestions before I take it in to Apple tomorrow.

  • Printing to printer on windows xp computer, only prints first page

    hey all, I need some help. i just switched to a mac and I am loving it, but in my small office, I am having trouble printing. Two printers are connected to a Windows XP computer. I can connect to them via the network and print, but it only prints the

  • ReferenceError: resetExtension is not defined

    Out of the blue, I get this error in Dreamweaver 8 on any page that I try to insert an image into. "The following JavaScript error(s) occurred: At line 7 of file "Harddrive: Applications: Macromedia Dreamweaver 8: Configuration: Objects: Common: Imag

  • Can't transfer files on ecternal devices

     hi. just wanna know why can't I transfer files on any other devices such as usb and etc. after I''ve updated my os? i really need to transfer files since internal storage is not that big. I hope you can reply as soon as possible. thank you!

  • Bi Beans Loosing Stylesheet On Weblogic 8.1

    Deploying a Bi Beans JSP application on Weblogic 8.1. After logging-in when it opens a catalog page (Open1.jsp) application looses stylesheet reference. Weblogic console throws following error <Aug 20, 2004 6:13:38 PM GMT-06:00> <Warning> <HTTP Sessi