Regular expressions... they are not regular! =)

So,
I've been pulling my hair out with regular expressions. I'm sure there is a logical explanation to this, but i've read a bunch of explanations and i THOUGHT i understood this, but i don't. Here goes:
I have a string "2010PETE". I tried matching it to "\\d{1,}" (this is how i entered it in Java). This returns FALSE. HOWEVER, it seems to me the above should be TRUE because it says that a greedy quantifier with {1,} searches for the the preceding character AT LEAST N times, where in this case n=1, so i interpret this as "If a digit (\\d) is found at least once within the string, then this string matches the regular expression. This does NOT seem to be the case.
Can someone clear this up for me?

THANK YOU. i think that is what i was missing, the part about
"would only match if the input consisted of at least one digit, possibly multiple digits, and nothing else."
I read the documentation and some of it didn't seem to be clear on that point.
i'll play around with this and see how far i can get. if i still have questions i will post some code for sure, and try to get a nice, rounded set of examples.
thanks!
ONE OTHER QUESTION I JUST THOUGHT OF: does the .matches() method match expressions when some substring of the String matches, or does it have to match the entire String? So, if i have the String "123ABC", and i ask to match "1 or more letters" will it fail because there are non-letters in the String, but then pass if i add "1 or more letters AND 1 or more digits"? so, in the latter every character in the String is accounted for in the search, as opposed to the first. Is that correct, or are there ways to JUST match some substring in the String instead of the whole thing? i WILL make some examples too... but does that make sense?
Edited by: pedron on Jan 12, 2012 3:23 PM

Similar Messages

  • When i login to my mac, it opens iTunes, Skype and AIM. I've tried deleting these from the login items, but they are not on the list.  Can anyone help?

    When i login to my mac, it opens iTunes, Skype and AIM. I've tried deleting these from the login items, but they are not on the list.  Can anyone help?

    babowa wrote:
    If you do not lock that folder immediately after deleting all the contents, it will simply populate again (Resume - a "feature" in Lion). You do that by doing a Get Info (highlight folder and press Command + I keys), unlock the lock at the bottom, enter your admin password, then check the box to lock the folder. lock the lock and you're done.
    Yes, that is correct. The alternative is to quit all applications prior to logging out. Lion will then have a chance to remove the saved states.
    babowa also wrote:
    And, for the OP:
    It has also been a regular feature of Mac OS to automatically open any window that was open at shutdown. To avoit that behavior, simply close any Finder windows and  properly quit applications by closing their window and using Command + Q (or File >Quit).
    This was true only for the Finder. Prior to Lion, no other apps would launch unless they were included in the Login Items for the account. And the OS would not restore windows for other apps.
    A very small number of apps (TextWrangler is an example) implemented this capability prior to Lion. They could restore previously opened windows. But that is an application feature, and can be controlled by the application's preferences. Lion implements it at the system level, and users have virtually no control on a per application basis.

  • When I sort bookmarks in "organize bookmarks" they are not sorted under the bookmarks pulldown menu. Latest additions are not integrated into the sort

    When I sort bookmarks in "Organize Bookmarks" they are not sorted under the pulldown menu on a regular page. Recently added bookmarks are not inegrated into to sorting.

    See this:
    [https://support.mozilla.com/en-US/kb/Sorting+bookmarks#Sorting_by_name]

  • I have problems with uploading images to my printing company have the images have been manipulated through CS6 i have saved images as jpeg but the printer company tell me they are not j peg, they will not upload images save from a camera are fine

    I have problems with uploading images to my internet printing company when  the images have been manipulated through CS6 and  i have saved images as jpeg  the printer company tell me they are not j peg,
    but images saved from my phone or camera images that have not been manipulated upload fine, What am i doing wrong?

    Save/Export them as JPG. Photoshop defaults to PSD, so make sure you select JPG and not just rename the file to .jpg.
    There are two ways to save them as JPG: Regular Save as option or Save for Web & Devices
    Take your pick.

  • HT4928 my purchased apps do not show up on my mac book but they do if i log in on my iPad,they are not hidden either, why is this?

    I have purchased loads of apps on my Ipad including pages and numbers, I want to use then on my new mac book pro so i logged in to my app store account and none of the apps I can access on my ipad show up in my "purchased" area. they are not hidden under my account settings either, how do i get them on my mac book, I have logged in to the app store via my ipad and theey are all on there, am I being a dumb fool? this is the first Macbook i have ever owned and dont know my way around, any help please!?

    Welcome to the Apple Support Communities
    Apps for the Mac and apps for the iPad are different and they can't be installed on the other one. Also, the iPad apps you purchased are on the App Store, and the Mac apps you purchase are on the Mac App Store, so you can't get your iPad apps on the Mac App Store.
    In your case, you have to buy Numbers and Pages for Mac on the Mac App Store, because OS X and iOS are different operating systems

  • HT204150 I can't get my contacts back on my phone from my icloud. It's up and running and I have already turned on the contacts. The icloud online shows that I still have all of my contacts but they are not popping up on my phone.

    I had my mom on my icloud through a different phone for the longest time and just took it off her phone today. Now all of my contacts have been erased from my phone. I went on the icloud online and it is showing that my contacts are still there, but they are not on my phone. I need help!!!

    Go to Settings>iCloud and confirm that you are signed into the account that contains you conacts and that the contacts setting is turned on.  Also open the contacts app and tap Groups (if you have this setting at the top) and make sure all your contacts groups are checked.
    If they still don't appear, go to Settings>iCloud, turn Contacts off, choose Delete from My iPhone when prompted (they will still be in iCloud), then turn Contacts on again.
    If they still don't appear, force-close the Contacts app and reset your phone: double-tap the home button, locate Contacts, swipe up on the image above the app icon to close it, tap the home button again.  Then hold the power and home buttons at the same time until you see the Apple logo, then release and wait for it to restart.  Then check your contacts again.

  • I am trying to transfer my movies (mp4 files) to my IPad, but they are not showing up on the IPad. I have 13 movies showing on my IPad that they are in ICloud. I've sync'd the movies I want to the IPad, but only one is showing under the "movies" folder. ?

    I have been trying to transfer some different movies from my PC to my IPad, but they are not showing in the "movie" folder. I have sync'd the movies (these are mp4 files) that I wanted transfered, but only one is showing in the folder. There are 13 other movies in the folder that have the ICloud symbol in the corner of their picture. I understand that I can pull those movies from ICloud any time I want to watch them, but I want to watch the ones that I've just sync'd with my IPad. How do I find them? After I checked the movies I wanted, I "applied" them and watched it sync and copy the wanted movies to my IPad. Now what?  Thanks.

    There are some good programs that you could use to convert the format, Handbrake or Mpegstreamclip are two good free ones. Convert them to MP4 and then try importing them again.

  • I purchased a bunch of songs on my iPhone but they are not showing up on it my computer.

    I purchased a bunch of songs recently on my iPhone but they are not showing up in iTunes on my computer.  They have always shown up in the past but these few haven't. I usually do a manual upload and backup of my phone, as opposed to doing it via icloud.
    In the meantime, I went to the purchases for my account and see that they are listed there and I hit "report a problem".  But it doesn't even ask me what the problem is....
    Is there anything else I can do?

    Go to View->Account and verify you're logged into the same AppleID as the iPhone
    Then go to iTunes->Preferences->Store and verify that "Show iTunes in the Cloud purchases" is checked.

  • I have purchased songs from itunes on my ipad but now they are not there anymore. How can they get them back? Dont come up in songs not on this ipad and in itunes it asks to buy again

    I have purchased songs from itunes on my ipad but now they are not there anymore. How can they get them back? Dont come up in songs not on this ipad and in itunes it asks to buy again

    If you are now in the US then you can only use the US store, so you should update the address on your account
    Changing country : Change the country of your iTunes Store, App Store, iBooks Store, and Mac App Store account.
    Had you copied the songs over to your computer's iTunes library, do they show in the Music section on it ? You can copy purchases that you still have on your iPad over to your computer's iTunes library via the File > Devices > Transfer Purchases menu option

  • HT201272 I downloaded sveral ringtones and they are not showing up in my purchased items.   I had to wipe out my phone so they are not on there anymore.  Please, any advice would be appreciated!

    I recently had to wipe out my phone and lost everything!  I have been able to recover all apps, pics, songs.  Lost alot of my contacts due to me not backing up my info to icloud more often.  (my mistake)  However, I cant find any of my purchased ringtones.  They are not showing up in my purchase history on itunes either.  I do have the receipts for all of them tho.
    Any advice or info would be greatly appreciated!

    Ringtones are currently a one-time only download, they won't appear under the Purchased tab nor in the cloud. Have you got copies of them in the Tones section of your computer's iTunes library or in the backup of your downloads that you can use to re-sync them to your phone ? If not, and they are still in the store, then you can try contacting iTunes support and see if they will grant you a re-download : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then try selecting Purchases, Billing & Redemption

  • HT201077 After updating my iPhone4s to the lastest update my photostream stopped updated onto my comuter.  From my phone it looks like pictures have been moved into the photostream folder... but they are not showing up on my computer.  Help!

    After updating my iPhone4s to the lastest update my photostream stopped updated onto my comuter.  From my phone it looks like pictures have been moved into the photostream folder... but they are not showing up on my computer.  Help!
    I have signed out then back into the cloud.  I have comfirmed location of the photostream folder.  I have have even restored settings on my phone.  any ideas on what I can do to get it working again?  or do I have to accept defect, and manually save my photos?

    There's a whole lot to read in your post, and frankly I have not read it all.
    Having said that, this troubleshooting guide should help:
    http://support.apple.com/kb/TS1538
    In particular, pay attention to the mobile device support sections near the bottom, assuming you have already done the items above it.

  • HT203164 I have purchased several books on tape via my computer and now want to sync them to my ipod....I can't find the appropriate buttons to do that.  Also though I have receipts for books purchased they are not showing up on my Itune purchased list. 

    I have purcase several audio books via Itunes and they are on my computer however I have been unable to figure out how to transfer (sync??) them to my Ipod.  Also I have receipts for several Itune audio books but they are not showing up on my purchased list. Help!!!

    lizdance40, audio books are NOT available for redownload. Books with words areavailable for redownload.
    See:
    http://www.tuaw.com/2013/04/03/audiobooks-are-not-backed-up-by-icloud-can-only-b e-downloaded-o/
    In the future please do not post incorrect information
    lizdance40 wrote:
    If iTunes still carries the books, they ARE available to download from the cloud, either to the computer or your iPod Touch directly.
    Open iBooks on the device and tap on 'purchased'. 
    download.
    iTunes does not garentee to carry a book forever, a serious flaw.  If you can't find the book in iTunes anymore and didn't keep it on the computer, or backed up, it may be gone.
    To add audio books to the iPod;
    you have to check the box at the bottom section of the Books screen that says, "sync audio books"

  • I recently deleted two albums off of my iphone via itunes but, they are still showing up on my phone, they are not albums that i have purchased through itunes, can someone help me figure out how to delete them please?

    I recently deleted two albums off of my phone using itunes, but when i went back onto my phone, they were still there and playable. they are not songs that I have purchased via itunes so can someone please help me figure out what is wrong so that i can fix the problem

    Hi, Abril_Perez17.
    This may be related to a new feature embedded in iOS7 that shows all purchased music by default.  Go to Settings > Music, then turn off Show All Music.  See if the issue ceases once the feature has been disabled.  This information is located on page 63 of the user guide below. 
    iPhone User Guide
    Regards,
    Jason H. 

  • On iCloud on my PC it shows that all my contacts are still on iCloud, but they are not showing up on my iPhone 4?

    Can you tell me why this is happening? I have synced my iPhone with iTunes on the PC and they have still not appeared in the phone contacts.

    If you are syncing your contacts from your PC with iCloud, they are not transferred to your phone using iTunes.  They are synced to your phone using iCloud, either over wifi or your cellular data network.
    First go to icloud.com with your computer browser, sign into your account and open Contacts there to confirm that your contacts appear.  If they do, go to Settings>iCloud on your phone, sign into your account and turn Contact on.  Assuming your phone is either connected to wifi or your cellular data network, the contacts should then download from iCloud to your phone.

  • I purchased several songs and they are not showing up in my purchased file. Tried to go online and re-download them but ITunes is not giving me option to download only the ones I am missing. It *****

    I contacted Itunes and they told me to go to my account and re-download the songs. I opened my account and found the recent purchases, but they are not recent, there are 250 songs in that list, how come? And ITunes didn't give me an option to download only the ones I am missing. I don't want to download 250 duplicate songs.
    The Itunes updates are worst each time, BTW, Just starting to get sick and tired of Mac and Apple and Itunes and all this complicated stuff because of your paranoia of people "stealing" songs, but in fact, who is going to download songs ilegally is going to do it anyway, So all you are doing is to make it difficult for honest people who actually buy the songs and can't have them. I reported the problem several times and didn't get any more answers. Hope this works before I disoute the charges of the songs I don't have.

    Hi samfergs,
    I'm not sure how the Purchased Playlist decides what to put into it, but if you want to see all of your purchased items, then you need to go to the iTunes Store, and on the right side, under Quick Links, click on Purchased.
    Then, click on the Music (or whatever other purchased items tab you want to look at). If you are looking at Music, click on All Songs, and then on "All" or "Not on this Computer" (depending on what you want to see).
    Cheers,
    GB

  • I have installed Itunes 10.5 on my PC and I have turned photostream on on my Ipad2 and Iphone.  The photos sync fine but they are not showing up on my PC.   What's the problem?

    I have installed Itunes 10.5 on my PC and I have turned photostream on on my Ipad2 and Iphone.  The photos sync fine but they are not showing up on my PC.   What's the problem?  I can see my photos on my ipad and Iphone.   I want to be able to see them on my PC when I take pictures from my Iphone and Ipad.  How do I see Photostream on my PC?

    You have to install the iCloud control panel for windows, then sign in with you apple ID, and check what you want to sync.
    link: http://support.apple.com/kb/DL1455

Maybe you are looking for

  • Change column headers dynamically in OBIEE

    hey guys. We are working on a BI module for Finance. The data mart captures data for Actuals/Forecasts and Budgets for entire year by months (for example Jan2008 will have Actual/Forecast value and Budget value & similarly for other months of the yea

  • Error while hiring an employee in pa40

    HI This occurs while hiring an employee in PA40. Runtime Errors         GETWA_NOT_ASSIGNED Short text      Field symbol has not yet been assigned.      Error in the ABAP Application Program      The current ABAP program "SAPLHRWF" had to be terminate

  • Open GR list

    Dear Experts,      Do you know If there is a standard report for Open GR list, which means the GR list without IR, in the report include the po number, GR number? Thanks! Cindy

  • SQL server service and SQL agent service

    Hi all. If I am going to use a Domain User to start SQl server service and SQL agent service, does the domain user need to  be SYSADMIN ????

  • LargeImage link missing in BCC application

    Hi, We are facing a strange issue in largeImage in BCC application. Please find the details below. In a sku we associate a largeImage which is a Media External and publish it completely to production. When we browse through that sku we see that large