Regex to match numbers but not characters

Hey all,
I brain must not be working right or something but I cannot for the life of me figure out how to get a regex to match numbers, but not characters.
e.g.
123456
would match, but
123abc
would not. Essentially what I want to do is take a string and only return a match when the string has numbers but no characters.

No, it doesn'tYes it does.
"123abc".matches("\\d+");
"abc123".matches("\\d+");
"123".matches("\\d+");
false,false,trueExcellent example demonstrating the output of a method.
However the suggestion above was referring to a regular expression, not a method.
And the above regular expression does match with the following methods
"123abc".replaceAll("\\d+", "xxx");
"abc123".replaceAll("\\d+", "xxx");
"123".replaceAll("\\d+", "xxx");
The correct regular expression to match only digits is....
^\d+$

Similar Messages

  • Edit GAL to show phone numbers but not email addresses

    We would like to edit our company's GAL to show only the phone numbers for some staff and not their exchange email accounts.  Is there a way to do this through Active Directory?
    AD Environment: Server 2008 R2 Standard
    Exchange Environment: Server 2008 Standard, Exchange server 2007.

    Link to the new thread: https://social.technet.microsoft.com/Forums/exchange/en-US/6c4158a6-107d-4da6-abad-c05106c20fde/edit-gal-to-show-phone-numbers-but-not-email-addresses?forum=exchange2010#371c659c-c002-4fb6-b5a1-ae776bf6534c
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • Use cellular data for iTunes Match & Radio but not app Updates

    Is there any way to set an iOS device so that it will allow using cellular data for iTunes Match and iTunes Radio but not downloading app Updates. I want to be able to set my wife's phone so that the apps are automatically updated over Wifi but she can then use iTunes Match and iTunes Radio when she is out. She only uses those in limited capacity so I am not too worried about her using up her data plan with those. However, app Downloads seems to be quite large, and they happened a lot recently when they all updated for iOS8.
    Thanks,
    Tony

    No, but you could turn off Updates under Automatic Downloads in Settings>iTunes & App Store, then update them manually when you're connected to wifi.

  • [CS2][JS]Page Numbering but not Page Number

    Please help javascript heroes.
    I am working on this doument that has a pagination but it requires an id line where i have to put the number of page but not the actual pagination. I know it sounds weird but to make the picture clearer:
    the header of the page is 469 to 524
    but on the footer it should be 1 to 56.
    is there anyway i can do this on the master page so i won't have to do this manually on the footer of each individual page?

    Here is a non finished version:
    if(app.documents.length!=0)
    var doc = app.activeDocument;
    var pg = doc.pages;
    mydlg();
    else
    alert("No documents open !");
    function mydlg()
    var start = pg[0].name;
    var end = pg[-1].name;
    var mydlg = app.dialogs.add({name:"False folio 1.0"});
    with(mydlg)
    with(dialogColumns.add())
    with(dialogRows.add())
    staticTexts.add({staticLabel:"From page"});
    var startField = realEditboxes.add({editValue:Number(start), minWidth:30});
    staticTexts.add({staticLabel:"to page"});
    var endField = realEditboxes.add({editValue:Number(end), minWidth:30});
    if(mydlg.show()==true)
    falseFolioLayer();
    var l = doc.layers.item("falseFolio");
    var start = startField.editValue;
    var end = endField.editValue
    var lg =Number(end) - Number(start);
    $.writeln(lg);
    for(i=1; i<=end; i++)
    var index = Number(start)-2+i;
    if(String(i/2).indexOf(".")==-1)
    x1 = 2*pageAttr(doc)[0]-pageAttr(doc)[4]-25;
    x2 = 2*pageAttr(doc)[0]-pageAttr(doc)[4];
    else
    x1 = 0+pageAttr(doc)[2];
    x2 = x1+25;
    var y1 = pageAttr(doc)[1]-pageAttr(doc)[3]-10;
    var y2 = y1+10;
    var folio = pg[index].textFrames.add(l,{geometricBounds:[y1,x1,y2,x2]});
    with(folio)
    contents = String(i)+"/"+lg;
    textFramePreferences.verticalJustification = VerticalJustification.BOTTOM_ALIGN;
    texts[0].justification = Justification.AWAY_FROM_BINDING_SIDE;
    function falseFolioLayer()
    var l = doc.layers;
    for(i=l.length-1; i>=0; i--)
    if(l[i].name=="falseFolio")
    l[i].remove();
    l.add({name:"falseFolio"});
    function pageAttr(doc)
    h = doc.documentPreferences.pageHeight;
    w = doc.documentPreferences.pageWidth;
    mb = doc.marginPreferences.bottom;
    ml = doc.marginPreferences.left;
    mr = doc.marginPreferences.right;
    return [w,h,ml,mb,mr];

  • HT204150 I have started randomly losing contact numbers, but not email addys for same contact

    I have started losing contact ph nbrs, not the email address if there is one. But random numbers just disappear.  Any advice?

    Hello hwestphal, 
    Thanks for contributing to the Apple Support Communities. 
    It looks like you were not able to send iMessages to your contacts, and you've solved it by turning iMessage and FaceTime off and on again. It sounds like after this, your friend is not receiving iMessages because they are sending from your phone number. 
    Next, I'd suggest the steps in this article to make sure that your phone number is linked to your Apple ID (email address):
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage - Apple Support
    Your friend may also want to try these steps on their iPhone when they are in range of cellular service. 
    Best Regards,
    Jeremy 

  • .How do I find out what Version (generation) of Ipod touch I have, as I want to know if I can download IOS 5 onto it? It was a gift so I only know the model and serial numbers but not the type

    Hi, can anyone help me out with this question?
    How can I find out which version of Ipod touch I have. I only have the model and serial numbers as it was a gift, but I would like to download IOS 5 if it is compatible?
    Very frustrated Ipod user, any advice would be much appreciated.
    Lynda.

    I had the same problem because there are so many iPod models.  There is a great article in Wikileaks that explains it all and also has pictures.  I'm confident this answer your question.

  • IMessage works for some numbers but not all

    Hello all!
    So I've run into a bit of a problem with my iMessage recently.
    Currently I've been able to fix it for some of my iphone friends but there's one that I just can't seem to get to work.
    So basically the rundown I did to fix it for the majority of my friends #'s was I
    Turned off Imessage and Facetime
    Restarted my phone
    Turned on imessage and facetime
    And that seemed to fix whatever was wrong with the majority of my friends.
    However, there's one that just won't work..I know that he doesn't have texting on his iphone because where he lives he doesn't get service so he relies on wifi to use imessage..It was working fine until a couple weeks ago when I couldn't send anyone an imessage..and then randomly it started sending from my email. So upon searching the internet I got it to go back to my number but now  I'm unable to text him anymore... It worked while on my email but once I got back on my number it didn't.!
    I'm not quite sure if it's on my end or his..but I hope I can get some answers here!
    Thanks!

    Hello hwestphal, 
    Thanks for contributing to the Apple Support Communities. 
    It looks like you were not able to send iMessages to your contacts, and you've solved it by turning iMessage and FaceTime off and on again. It sounds like after this, your friend is not receiving iMessages because they are sending from your phone number. 
    Next, I'd suggest the steps in this article to make sure that your phone number is linked to your Apple ID (email address):
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage - Apple Support
    Your friend may also want to try these steps on their iPhone when they are in range of cellular service. 
    Best Regards,
    Jeremy 

  • Color sample chart shows names and numbers but not the color sample

    on our website we display multiple pages with a color sample chart.
    The descriptions of this chart still displays but the color samples are not shown.

    You can also check for errors in the "Web Developer > Web Console" (Ctrl+Shift+K)
    *https://developer.mozilla.org/en/Tools/Web_Console
    Current Firefox versions have a lot of built-in web developer tools including an Inspector and Style editor.
    *https://developer.mozilla.org/en/Tools
    *https://developer.mozilla.org/en/Tools/Page_Inspector
    *https://developer.mozilla.org/en/Tools/Page_Inspector/HTML_panel
    *https://developer.mozilla.org/en/Tools/Page_Inspector/Style_panel

  • Imported phots sequential numbered but not in time order?

    I import my photos and I will name them say ball, and I have Elements set to number them starting with 1, so I get ball1, ball2 etc, but problem is that these files are imported but are not in order of time I would like the first photo taken to be ball1 and the last ball99. But when I go into Windows Explorer and I see that the photos are not in order say that ball5 might be first then ball9 next etc. How can I have Elements import photos and keep them in order of time taken.

    It's not possible to change the sort order.

  • WILL NOT TAKE REDEMPTION CODE  IT WILL TAKE THE NUMBERS BUT NOT LETTERS  WHEN I TYPE IT IN

    IWhen i type in  my redemption code it will not type the letters only the numbers

    Most likely you are trying to enter a redemption code into a serial number entry.  Redemption codes are normally used for acquiring the serial number that you would enter. 
    Redemption Code Help
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • Excel attachment displays numbers but not letters

    I have and excel attachment exported from access 2007.  When I open it on an IOS device, I can only see the contents of cells with numbers.  The cells that contain letters are blank.

    Most likely you are trying to enter a redemption code into a serial number entry.  Redemption codes are normally used for acquiring the serial number that you would enter. 
    Redemption Code Help
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • HT204406 I have subscribed to iTunes Match/Cloud, but not all of my playlists I've created are showing up on my iphone??

    How do you get all your playlists you've created on your laptop itunes acct to show up on your iphone?

    Are all of the 2500 picture from your camera roll?
    restoring pics back from an icloud backup, usually takes awhile couple hours or so, esp since you have 2500 pics.

  • I am having a problem entering redemption code.  I can enter numbers but when I try to enter any letters it's like the computer is locked up, but it's not on any other application

    I am having a problem entering my redemption code.  I can enter numbers but not any letters.  It's like the computer is locked up when I try.  My letters work on any other application

    It sounds like you are trying to use a redemption code (alpha-numeric) where you are supposed to be using a serial number (strictly numeric).  A redemption is normally used to acquire a serial number... the serial number is what you enter to activate the software.
    Redemption Code Help
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • Can message some but not all

    I can message some phone numbers but not all.  How can I tell what is causing the not delivered message?

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Set Up Alert Sounds
    http://www.quepublishing.com/articles/article.aspx?p=1873027&seqNum=3
    Extra FaceTime IDs
    http://tinyurl.com/k683gr4
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Fix Can’t Sign Into FaceTime or iMessage iOS 7
    http://ipadtutr.com/fix-login-facetime-imessage-ios-7/
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    iOS 7 allows you to block phone numbers or e-mail addresses from contacting you via the Phone, FaceTime, or Messages
    http://howto.cnet.com/8301-11310_39-57602643-285/you-can-block-people-from-conta cting-you-on-ios-7/
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457#19087457
    How to watch FaceTime calls on the big screen with Apple TV
    http://www.imore.com/daily-tip-ios-5-airplay-mirroring-facetime
    Send an iMessage as a Text Message Instead with a Quick Tap & Hold
    http://osxdaily.com/2012/11/18/send-imessage-as-text-message/
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    How to Receive SMS Messages on an iPad
    http://yourbusiness.azcentral.com/receive-sms-messages-ipad-16776.html
    Apps for Texting http://appadvice.com/appguides/show/apps-for-texting
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • RegEx for characters with accents and such but not alphanum or punctuation

    I'm creating a fuction that checks for the following code snip. I'm having trouble understanding what I need to do to get the last criteria. How do I specifically check for characters with additional marks  such as   a'   but  not  a
    Thanks in advance for any help or advice you might give
        <!---Contain characters from three of the following five categories:--->
                <!---English uppercase characters (A through Z)--->
       <cfif ReFind("[[:upper:]]+",passwd,0, false) gt 0>
        <cfset numCharSets = numCharSets + 1>
       </cfif>
                <!---English lowercase characters (a through z)--->
       <cfif ReFind("[[:lower:]]+",passwd,0, false) gt 0>
        <cfset numCharSets = numCharSets + 1>
       </cfif>
                <!---Base 10 digits (0 through 9)--->
       <cfif ReFind("[[:digit:]]+",passwd,0, false) gt 0>
        <cfset numCharSets = numCharSets + 1>
       </cfif>
                <!---Non-alphabetic characters (for example, !, $, #, %)--->
       <cfif ReFind("[[:punct:]]+",passwd,0, false) gt 0>
        <cfset numCharSets = numCharSets + 1>
       </cfif>
                <!---A catch-all category of any Unicode character that does not fall under the
          previous four categories. This fifth category can be regionally specific.--->

    AWEInCA1 wrote:
    How do I specifically check for characters with additional marks  such as   a'   but  not  a
    By recognizing they are seperate characters.  You will probably want to use codes to access these characters.
    \uFFFF where FFFF are 4 hexadecimal digits
    Matches a specific Unicode code point. Can be used inside character classes.
    \u00E0 matches à encoded as U+00E0 only. \u00A9 matches ©
    http://www.regular-expressions.info/refunicode.html
    http://www.regular-expressions.info/reference.html

Maybe you are looking for

  • Can't find latest snapshot while generating AWR in RAC

    Hello, we take snapshot every 20 minutes. In RAC (10.2.0.4), instance 2, run query, SELECT snap_id, begin_interval_time, end_interval_time FROM dba_hist_snapshot ORDER BY 1 3391 26-AUG-10 09.00.14.425 AM 26-AUG-10 09.20.05.485 AM 3392 26-AUG-10 09.20

  • Add java classes as Additional Classes to web service and JAXB 2.0 usage

    Hi, I start using JDeveloper 11g TP3 to create web service. I encounter two problems. 1. I created a schema file as the following, <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://FromWSDL/" xmlns:xsd="http://www.w3.org/2001/X

  • Can't recognise .MOV files sent from iPhone 3Gs

    I get the following message when trying to open quicktime .MOV files on my MacBook emailed from my brother's iPhone 3Gs: 'The document "IMG_0163.MOV" could not be opened. The movie is not in a format that QuickTime Player understands.' It's been happ

  • GUI element question

    Hey guys. I was wondering, is it possible to create this GUI element with Scripting? I could create EditText element, but I'd like to use, if possible, this more elegant way for user to input values. I am talking about 120 / 84 / 0 elements in this G

  • Automator workflow hangs indefinitely after running Python script

    Hello, I have an Automator workflow set up to use a one-line shell script to launch a Python script. The Python script has a GUI and stays open for the user to interact with it. It launches fine, but I've noticed that my Automator workflow hangs and