Regex to allow only integer and decimal numbers.

Hi all

I need a regex to allow only integers and decimal numbers.

Examples:

100 licences

100.00 - Unauthorized

100 - unauthorized

100.11.22 - unauthorized

all characters other than numbers - unauthorized

I used the regular expression - ^ [0-9] +. ? [0-9] * $- but its allowing the "100" also.

Can someone help me solve this problem.

Your timely assistance is greatly appreciated.

Thanks in advance.

Hello

inDiscover wrote:

Hi all

I need a regex to allow only integers and decimal numbers.

Examples:

100 licences

100.00 - Unauthorized

100 - unauthorized

100.11.22 - unauthorized

all characters other than numbers - unauthorized

I used the regular expression - ^ [0-9] +. ? [0-9] * $- but its allowing the "100" also.

Can someone help me solve this problem.

Your timely assistance is greatly appreciated.

Thanks in advance.

Use

^[0-9]+(\.[ 0-9] +) ? $

to make the decimal point and the following figures (of which there must be at least 1), as a unit, as an option.

Tags: Database

Similar Questions

  • mx459 won't let me enter the WEP key number, allows only symbols and letters. How to enter numbers?

    mx459 won't let me enter the WEP key number, allows only symbols or letters. How to enter numbers?

    John

    This might help

    Press the SETUP button on the control panel of your printer.
    Using the arrows, select DEVICE SETTINGS, press OK.
    Select local network SETTINGS, then press OK.
    Select Configuration LAN wireless, and then press OK.
    If a message appears, press the WPS button, press STOP to cancel.
    Select STANDARD INSTALLATION in the next screen that appears, and then press OK.
    Select your access point or router, and then press OK.
    Press OK to confirm the access point name.
    Enter your password using the numeric keypad on the right.
    On the screen where you enter your password at the top right of the LCD screen, you should see a: 1. This indicates you are in digital input mode. If you press the asterisk (*) will be fixed: has or uppercase mode, pressing asterisk with tiny switch. To enter a letter in letter mode, you press the digital key to scroll through the available letters. For example: to enter a letter 'c', you press the '2' three times.
    Press OK when finished.
    The LCD will say "Connected", if the password is correct.

  • What type of file can be stored in I cloud drive... I was told only pdf and pages, numbers and keynotes... is that correct?

    What type of file can be stored in iCloud drive... She was told only pdf. and apps pages, numbers and keynotes... is that correct?

    You can store any type of file in iCloud drive.

  • XMLELEMENT and decimal numbers

    Hello members,

    I just encountered a problem, indicating that XMLELEMENT depends on NLS parameters.
    SQL> alter session set nls_numeric_characters = ',.'
      2  /
    
    Session altered.
    
    SQL> select xmlelement("x",1.23) from dual
      2  /
    
    XMLELEMENT("X",1.23)
    -----------------------------------------------------------------
    <x>1,23</x>
    
    SQL> alter session set nls_numeric_characters= '.,'
      2  /
    
    Session altered.
    
    SQL> select xmlelement("x",1.23) from dual
      2  /
    
    XMLELEMENT("X",1.23)
    -----------------------------------------------------------------
    <x>1.23</x>
    
    SQL> select *from v$version
      2  /
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    
    SQL>
    This kind of surprises me, especially since according to the DB 10 g Release 2 XML Developer's Guide (10.2), the W3C standards are in the spotlight since 10gr 2:
    http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14259/xdb13gen.htm#i1028612
    The XML schema standard specifies that the dates and timestamps in the XML are in standard formats.
    Generation of XML in Oracle XML DB functions produce dates XML and timestamps in accordance with this standard.

    In earlier versions of Oracle Database 10 g Release 2, the parameters of database date and timestamp formats were used for XML, instead of the standard formats of XML schema.
    You can reproduce this behavior by setting the database event 19119, level 0 x 8, as follows:
    if anyone can confirm, perhaps even explain above behavior?
    -Maybe I'm just deceiving myself, somehow?


    Sorry to ask, but I tried to search (a little) for an answer ;)

    Best regards
    Peter

    Peter Gjelstrup wrote:

    I just encountered a problem, indicating that XMLELEMENT depends on NLS parameters.

    And what else did you expect? Have you read the docs on XMLELEMENT? Value_expr parameter is a string. You pass a number. That's why Oracle implicitly converts to a string. And of course, it uses nls_numeric_characters for this.

    SY.

  • regualr expression: space and alphanumeric characters are allowed only.

    What is the best way to determine the needs of the company:
    1 string entry can contain only: characters, numbers, space.
    For example "an A1" is correct because there is only space and a number and characters, but ' aA. 1' is not correct because it contains the point which is not allowed.

    My original request:
    with T as
    (select 'a A1' VAL from dual union 
    select 'a.A1' VAL from dual union
    select 'aA1' VAL from dual  union
    select 'aA .1' VAL from dual)
    select VAL, REGEXP_INSTR(VAL, '([^[:alnum:]])') NotAlphanum, REGEXP_INSTR(VAL, '([^ ])') notspace,
    REGEXP_INSTR(VAL, '([^[:alnum:] ])') NotAlphanumORSpace
    from T
    ;
    (I'll do it later "If count (1) > 0 ' or ' If NOT count (1) > 0" of the application of the rule is not important if we're going to do the implementation as the rule of bargaining or negotiating not. ")
    SQL> with T as
      2  (select 'a A1' VAL from dual union
      3  select 'a.A1' VAL from dual union
      4  select 'aA1' VAL from dual  union
      5  select 'aA .1' VAL from dual)
      6  select VAL, DECODE(REGEXP_instr(VAL, '([^[:alnum:][:space:]])'),0,
      7  'Only Alfa Numerci or Space','Other than that') from T;
    
    VAL   DECODE(REGEXP_INSTR(VAL,'(
    ----- --------------------------
    a A1  Only Alfa Numerci or Space
    a.A1  Other than that
    aA .1 Other than that
    aA1   Only Alfa Numerci or Space
    
  • remove all punctuation - only letters and numbers

    Hello

    How can I remove all the punctuation marks . As a result, only the letters and numbers stand ?


    Example:

    Chain before: "§ 67778 / % & $45-§§ 5FCGZZ-GZGUU(=&/+%/&%E$Dfcfhzb+++zvb).

    String that follows: 67778455fcgzzgzguuedfcfhzbzvb

    My Code so far:

    REPLACE)

    REPLACE)

    REPLACE)

    REPLACE)

    REPLACE)

    TRANSLATE)

    LOWER (TRIM (DESIGNATION))

    , '@-.', '@' )

    , ' ', '')

    , ' ', '')

    , '', '')

    , '-', '')

    CHR (10), ")

    Thank you for your help in advance

    2890953 wrote:

    How can I remove all signs of punctuation. Thus, only letters and numbers stand?

    Example:

    Chain before: "§%67778/%&45$$---§§$5FCGZZ-GZGUU (=&/+%/&%E$Dfcfhzb+++zvb.

    String that follows: 67778455fcgzzgzguuedfcfhzbzvb

    My Code so far:

    REPLACE)

    REPLACE)

    REPLACE)

    REPLACE)

    REPLACE)

    TRANSLATE)

    LOWER (TRIM (DESIGNATION))

    , '@-.', '@' )

    , ' ', '')

    , ' ', '')

    , '', '')

    , '-', '')

    CHR (10), ")

    In Oracle 10 and above, use regular expressions:

    SQL > select

    2 regexp_replace ("' §%67778/%&45$$---§§$5FCGZZ-GZGUU (=&/+%/&%E$ Dfcfhzb +++ zvb ',' [^ [: alnum:]]') s '")

    3 of

    4 double;

    S

    -----------------------------------

    §6777845§§5FCGZZGZGUUEDfcfhzbzvb

  • Hi, I have bought LR6 and installed cloud creative ok, but when you go to installation of Lr, it allows only one installation of the trial version, the other options are to buy. I expect that when I pay 129 euros for the LR I can install it easily and not

    I bought LR6 and installed cloud creative ok, but when you go to installation of Lr, it allows only one installation of the trial version, the other options are to buy.

    Serialize Lightroom trial to activate like Lightroom 6 CC

    https://helpx.Adobe.com/Lightroom/KB/serialize-Lightroom-CC-trial-to-activate-as-Lightroom - 6.html

  • Export of collections to the external file allows only export as a jpeg image and not the original file types?

    Export of collections to the external file allows only export as a jpeg image and not the original file types?

    Why is this?

    DOOH-just found out why. the video bar was enabled prevail so on options-now them it works thank you for your answers.

    George

  • formatting of scale to display only integer values

    I'm trying to simply display a graph that has the integer values only and therfore that only integer values appears in the balance to alleviate the congestion of the eye on the chart.  Someone knows how this fundamental?

    If wire you an integer to the graphic terminal data type it should change the entire representation and take care of the problem.

    You can also set numbers of precision in graph to zero properties.

    Lynn

  • Only integer part

    Hello world

    I am a new user of Labview (v 2009). I try to save my electrometer (Keithley 617) data in a table (time and electric power). And it works, I can see this data in a text file, with the time left and on the right the current value. The problem is that I can save only the integer part. The current, I am trying to record is something like 10-12 A. So if I don't multiply by a constant of 10E15 for example, the result would be 0 instead of 0.00... 004658 A. And it's the same for the time. I can see, for example, 1, 1, 1, 2, 2, 3, 3 instead of 1.034 1.45, 1.89, 2.36, 2.98, 3.48, 3.95. I try to change the format, but this does not solve the problem of the whole part. I would like to see the integer (whole and decimal parts). Enclosed, please find my program. Also I have 2 attachments. Test01 is what I would like to save, and test02 is what I currently record. Could you help me please?

    Thank you!

    PS: I try to expose the best I can for my problem, I'm French...

    Okay, I think I found a solution. It lacked a float double precision "DBL" just before the part 'measure '. I enclose my program and the results.

    Thank you very much for your help!

    Thomas.

  • Align decimal numbers for the track list

    Hello, you showed me how do it long ago and have forgotten since. I have a Tracklisting of a paragraph as follows:

    1.

    2.

    3.

    4.

    5.

    6.

    7.

    8.

    9.

    10.

    11.

    I followed the tabs tut in the CC tut who says line right to the top of the box of the tab with the text block, click align decimal numbers and click where you want to go, I get the orange arrow, but nothing aligns. The UTU uses a table for example, is the only way it will work?

    Kind regards.

    If you do just a numbered list, you only need to use tabs to align on the decimal point. Simply insert a fixed space called a figure space.

    Make sure your numbers are of equal width. Since the character or control panel menu > OpenType, make sure Tabular Lining is set for numbers:

    Then in front of 1, 2, etc. Insert a space figure (Type > insert a space > Figure space). White space is the width of any character. You can use several spaces figure if you were with a very large number.

  • Calculation of tabular form, problem with decimal numbers

    Hello

    I wrote a simple java script function that is responsible for calculating the price * quantity and store that value to total_price.

    function CalcTotalPrice (pThis)
    {
    var vRow = pThis.id.substr (pThis.id.indexOf ('_') + 1);
    html_GetElement ('f07_' + vRow). Value = parseInt (html_GetElement('f06_'+vRow).value, 10) * parseInt (html_GetElement('f05_'+vRow).value, 10);
    }

    The function calculation is correct, but I have problem when the price or quantity decimal numbers.
    For example.
    Currently:
    price * quantity = total_price
    7.5 * 1 = 7 instead of * cf. 7.5 *.

    I've already put a mask of correct format for all of these areas (999G999G999G999G990D00).

    I appreciate your help.

    Request Express 4.2.1.00.08
    Oracle Database 11g Express Edition Release 11.2.0.2.0

    Kind regards

    Hi John,.

    before the multiplication, you analyze your values as an integer, so 'cut' the decimals.
    Replace "parseInt" by "parseFloat" should do the trick.

    function CalcTotalPrice(pThis)
    {
    var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
    html_GetElement('f07_'+vRow).value = parseFloat(html_GetElement('f06_'+vRow).value, 10) * parseFloat(html_GetElement('f05_'+vRow).value, 10);
    }
    

    Please let me know if this worked for you.

    Thank you
    Sandro

  • Grouping and decimal characters in rtf templates.

    Hi guys and girls,

    I'm really struggling with a problem here about decimal characters for the price in my outings.

    I use XML Publisher 5.6.3.

    My goal is to control the character grouping and decimal of my model.

    The numbers in the XML data file can be 10,000.00 or 10,000.00. The format is managed by the users nls_numeric_characters profile option.

    The output of the model will be based on the locale and not the data generated by Oracle reports. For example: reports to U.S. customers must show the number in the format according to 10,000.00. Reports to our European customers must indicate the numbers in this format 10,000.00.

    How can I achieve this in my models? It is possible at all?

    Thank you in advance.

    Kenneth Kristoffersen

    Published by: Kenneth_ on May 19, 2009 01:30

    If you go, stick to the old query and want new changes, I fear its bit difficult and that he must go around to bypass only :)

    use function to translate and replace points like this

    Re: XML-22036 cannot convert XXXXX number

  • Sometimes a web page is displayed with only text and no picures. It is not always the same site and is not always the case. If I'm going to explore for the same website that always works

    Sometimes a web page is displayed with only text and no picures. It is not always the same site and is not always the case. If I'm going to explore for the same website that always works

    Hello

    Also try a Ctrl + F5 refresh. This allows to bring the content of the page again.

  • My version of Firefox is 7.0.1. My bank allows only version 3.6. How do I adapt so I can do my banking online?

    My version of Firefox is 7.0.1. My bank allows only version 3.6. How do I adapt so I can do my banking online? I use a Mac.

    You could install version 3.6 next to your current version. Just download the current language of http://www.mozilla.org/en-US/firefox/all-older.html and then in the Setup program, change the installation location. You can just change the last part of the installation location (where it says Mozilla Firefox) for Mozilla Firefox2

Maybe you are looking for

  • How to perform the reset operation after an operation?

    Hello I want to know the reset function. in my system, I'm dealing with a different instrument like power, GPS, GSM... in my system, I have 2 article to article 1, I put only ON and OFF of my devices and operation to the second section so that I have

  • How can I save image transparent

    I would like to save an image with transparency, but it shows a gray background. It looks like all the information of the image are lost when I rebuilt the image on the table (table IMAGE to image.vi). For more information, I have attached the vi. Th

  • Aspire 5920 does not?

    power cable is triggered on and be portable fall or simply turned off. Don't know the whole story. Plug and light blue. Press the power on button and blue light turns off and the laptop is dead - nothing I stripped and 19v gets to the mini-plug of ma

  • MODBUS RTU read how to ignore the error

    Hello I have a problem, how to jump when the error of communication if I use the Modbus Library? I want this as smoothly without error on the chart. Look at this video I save my problem: https://drive.Google.com/file/d/0B_94Z4CwsTYeWEJpZUx2cVJ0a2c/ed

  • I have a lot of activity of page file and page faults with 2.5 GB of RAM memory

    Hello I tried to find the reason for the slow performance on my pc and the limiting factor seems to be the activity of page file and errors of memory page. It is Win XP sp 3 with 2.5 GB of RAM and a processor 2.8 GHz (core). The task manager has neve