Validate a number using regex

I would like to validate numbers using regex, and thought that a search both here on the net would produce what I was looking for, but...
The closest I can get to a number validation sequence (thankyou www.interviewjava.com) was the following:
"^[-+]?[0-9]*\\.?[0-9]+$"
but unfortunately it is incomplete. The explanation of the code is as follows:
* ^[-+]? : Starts with an optional “+” or “-” sign. [0-9]* : May have
* one or more digits. \\.? : May contain an optional “.” (decimal
* point) character. [0-9]+$ : ends with numeric digit.
Can anyone point me to a validation sequence that includes the comma for separating thousands? (The comma can appear multiple times, and is always followed by three digits).
I'd be very grateful for any help on this. Thankyou.

Thank you very much for your incredibly fast reply.
Did you cook that up yourself in the seven minutes since I posted the question, or did you have it somewhere ready?

Similar Messages

  • SAP IDM : Using regex for password

    Hi experts,
    I need your help about regex.
    We are trying to use this to be sure that password set in Web inteface by users are correct according to the company policies :
    - The first character cannot be a number
    - The three first characters cannot be the same
    We finally found the following expression to test what we want (reponse is "true" when one of the policies is ok) :
    (.)(1)|(d)
    But IDM never accept any password with that expression.
    So my questions are :
    1) Does IDM need a special regex language or is it the same than PERL language for example?
    2) Does anybody know how to use regex in our policies case?
    Thanks a lot for your response.
    Regards.
    Jérémy.

    Thanks a lot for your answers.
    Actually, i am already doing my test on another attribut which is not encrypted. but yeah its a good point to know about the encryption.
    I also tried to use evaluators on internet and my expression looks good if i want to catch cases that i dont want in my password...
    as a reminder : (.)(\1)|(\d)
    So if i write :
    "1password"   >> result : true
    "password"     >> result : false
    "pppassword" >> result : true
    "password01" >> result : false
    "passwooord" >> result : false
    but finally if i put that expression in the field "regex" of my attribut, IDM never let me save my new password because it's not a "correct value".
    So im disapointed because i don't how to solve it in IDM but i feel like i found the good expression...
    Any another idea?
    Regards
    Jeremy

  • Extract the numbers in string using regex

    Hi,
    How to extract the numers in string using regex?.
    Already i tried split up the string using [\\s]
    For ex: "Uting Tatk and Window Panet 15"
    it gives the ans 15.
    if the string is
    For ex: "Uting Tatk and Window Panet 15 New!"
    i can't find the number.
    so plz give me some idea to get the number frm String.
    Thanks

    I am developing a java project to extract Table of
    content in a particular
    PDF.
    i extracted all topics.
    then i want 2 extract page number from dat extracted
    TOC.
    if the TOC ends with number then i can easily find
    out the number
    but in vain if the TOC ends with like this
    "Uting Tatk and Window Panet 15 New!".
    i could n't find the page number.What will you do if it says:
    "15 ways to find topics 42 new"

  • Validating input if nonalphanumeric character without using regex

    Hi Guys,
    I am trying to validate if the user input does not contain any alphanumeric characters such as (A-Z, a-z, 0-9)... The problem was solved through this forum by using regex....
    Unfortunately I'm developing with Blackberry (RIM IDE) but it seems that it doesn't support java.util.regex.Pattern and java.util.regex.Matcher;
    Is there any other solutions to this problem? Can java.util.regex.* be added to Blackberry JDE?
    If anybody knows any solution to this problem...Please let me know...
    Please help... Thanks in advance

    public boolean method(String s) {
        loop over String {
            if (current char is not a valid char) {
                return false;
        return true;
    }

  • Assign external delivery number using BAPI_DELIVERYPROCESSING_EXEC

    Hi Experts,
    How to assign the external delivery number using "BAPI_DELIVERYPROCESSING_EXEC?
    For internal no, the BAPI works and I try to pass the parameters "tbl_request-EXTDELV_NO = XXX" to the BAPI , it prompt an error "Unexpected issue of error message (output NR 751)"
    Thanks

    Hi,
    Please check the external number which you are giving is within the number  Range defined  in Configuration  .
    regards
    Deepak.

  • How do I change the phone number used for iMessage on iPad 4

    I want to change the phone number used on iMessage on iPad.  Any help?

    It's best to use an email address (gmail.com?) for FaceTime and iMessage on your iPad.
    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
    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/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    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/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    For 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
     Cheers, Tom

  • Is there a way to create a toll free number using an app?

    Is there a way to create a toll free number using an app?

    I guess if you owned your own network you could. But, if you owned the network, you wouldn't need an app. Otherwise, how do you think you're gonna just create a "toll free number"?

  • In my iPhone 4 interface (running OS 7.0.4), a red number used to appear, to indicate a new text message. That number hasn't appeared for a few weeks. I can't seem to find a way to turn it back on using the Settings. Is this a bug?

    A red number used to appear in my interface when I receive new text messages. That number no longer appears. Scouring the Settings to turn it back on hasn't been successful. Is this a new bug? How can I get the red number to appear again?

    Quit, then relaunch the App.
    Restart the device.
    Reset the device.
    Reset all settings of the device.
    Test after each step.

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • How can I dial to a phone number using land line, internal PC modem and LabVIEW 8.2

    I will start to write a LabVIEW 8.2.1 program which dial to a phone number using my Dell Inspiron, Windows XP. Does any body have an idea how can I do it? or better if any body have a vi ready.
    I will appreciate your help 
    Thanks in advance
    Solved!
    Go to Solution.

    The link Somil provided is very good.
    Neddless to say that you need a modem.  And the modem's user or programmer's guide.
    Most modems have the same command structure, however, there might be some nuances depending on the manufacturer and the model, hopefully taken care by the driver.  Oh yeah..  You'll need the driver. 
    I remember reading some posts and possibly some examples somewhere in this forum.  I'm sure a search will reveal a lot of information.

  • Use SQL function to get the original order number using the invoice number

    Hi All,
    wondering is someone can help me with this challenge I am having?  Often I need to return the original order numbers that created the resulting invoce.  This is a relatively simple seriese of joins in a query but I am wanting to simplify it using a SQL function that can be referenced each time easily from with in the SELECT statement.  the code i currently have is:
    Use SQL function to get the original order number using the invoice number
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    RETURN @OrderList 
    END
    it is run by the following query:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number here'
    The issue is that this returns the order number for all of the lines in the invoice.  Only want to see the summary of the order numbers.  ie if 3 orders were used to make a 20 line inovice I only want to see the 3 order numbers retuned in the field.
    If this was a simple reporting SELECT query I would use SELECT DISTINCT.  But I can't do that.
    Any ideas?
    Thanks,
    Mike

    Thanks Gordon,
    I am trying to get away from the massive table access list everytime I write a query where I need to access the original order number of the invoice.  However, I have managed to solve my own problem with a GROUP BY statement!
    Others may be interested so, the code is this:
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    GROUP BY T6.DocNum
    RETURN @OrderList 
    END
    and to call it use this:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number'

  • How To Color a Text string using Regex (java.util.regex)

    Hello,
    How can I color a text string using regex class in 1.4?

    Yes, did you notice it said something about incredibly vague functionality?
    Let me break it down for you
    > How can I color a text string
    Strings do not have color... You can color a component (a label, a button), but you can't color a string
    > using regex class in 1.4?
    Using a regular expression? How would a regular exression color anything? Do you have embedded color codes? Are you searhing a string for some secret word?
    What are you talking about?

  • If I call my Skype-To-Go number (using my Skype re...

    If I call my Skype-To-Go number (using my Skype registered CELL phone) to call a LANDLINE phone in Japan, WHY will I be charged the JAPAN MOBILE rate of $0.18/minute INSTEAD OF the JAPAN LANDLINE rate of $0.03/minute (+ VAT + connection fee)?
    Solved!
    Go to Solution.

    Hello,
    I need your STG # please.
    (VAT is not charged on call rates in any location).
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • How to validate the number of characters in Text Entry box?

    Hi
    I have inserted a text entry box and assigned a variable (UserName) to it. Now, I need to limit the entry to a maxinum number of 20 characters. In other words, how do I validate the number of characters in the text entry box and provide feedback if it is more than 20 characters?

    Thanks.
    I have posted this as a query on the relevant post on Jim's website. I am too new to regular expressions. I hope he will help with an example as well.
    http://captivatedev.com/2012/07/31/adobe-captivate-6-x-widget-text-entry-box-validator/
    Sreekanth

  • Getting Serial Number using BlackBerry PIn

    Hi guys
    does anyone know how to generate the device serial number using the PIN? My precious limited edition just got stolen at an accident a few minutes ago.
    BlackBerry Protect on location it's shaded out, likely won't be able to see it's location once wiped. Though I do hope to recover it.
    Please help. The box is more than 1000 miles away and can only access it probably once my mum is back there from her holiday this side in about a month.
    Twitter: @IAmBenGiey | Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
    Try my apps:
    The Ultimate Currency Converter and T2G - BloGFeed

    Your carrier should have that on file so giving them a call would be an idea.
    It's a good idea to call them anyway to cancel the SIM card ASAP.
    Cheers.
    - If my response has helped you, please click "Options" beside my post and mark it as solved. Clicking the "thumbs up" icon near the bottom of my response would also be appreciated.

Maybe you are looking for

  • Trim (SSD) in 10.6.7 - ? and what happens to the SSD if not?

    Am I up to date in assuming that there is no way to know when 10.6.7 will be released or whether it'll allow for using the trim function on SSDs (for all, not bizarrely just for new MacBooks)? And, second question, if 10.7 will indeed provide this fu

  • How to tell if application is hanging or still working?

    I occasionally ask photoshop to do very large jobs such as joining many images into panoramas. This can take a very long time, and sometimes Photoshop will show as 'not responding' in red on the activity monitor or force quit window, and will hang un

  • Remote access and network services problem

    I have a Mac Pro with two IP configs: Ethernet 1: 69.##.##.## /255.255.255.248 [hidden for public forum security] Ethernet 2: 10.0.0.20/255.255.255.0 My primary needs: Able to remotely access the Mac via Remote Desktop using the public IP. Local LAN

  • Group SQL data in XML Format

    Hi All, I have t-sql result set (Shown in image). I want to convert it into xml data format (like the code under Edit this code section). There can be any number of clients and any number of projects. Can some one please help me out on this.

  • Error at the time of Display of Excise Invoice.

    Dear All, My Excise Invoice got saved with the correct values and also the correct number got generated.However when I am going to the display of excise invoice and input the excise invoice number,given the excise year as 2008 and given the correct s