Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. regex dont match comma
Qt 6.11 is out! See what's new in the release blog

regex dont match comma

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NotYourFan
    wrote on last edited by
    #1

    Hey,

    i have a TableView with InputFields, with this Inputs i make some mathoperations.
    My inputs works perfect and the calculations also.
    Now i need a regex for integers and floats (DONT allow comma)
    For example:

    1. Input: 123.3 --> i match 123.3 (that is perfect for me )
    2. Input: 123 --> i match 123 (that is perfect for me)
    3. Input 123,3 --> i match 123 (here i DONT want to match anything)

    Following my regex:

    (\d*[.]?\d*)
    
    Gojir4G 1 Reply Last reply
    0
    • N NotYourFan

      Hey,

      i have a TableView with InputFields, with this Inputs i make some mathoperations.
      My inputs works perfect and the calculations also.
      Now i need a regex for integers and floats (DONT allow comma)
      For example:

      1. Input: 123.3 --> i match 123.3 (that is perfect for me )
      2. Input: 123 --> i match 123 (that is perfect for me)
      3. Input 123,3 --> i match 123 (here i DONT want to match anything)

      Following my regex:

      (\d*[.]?\d*)
      
      Gojir4G Offline
      Gojir4G Offline
      Gojir4
      wrote on last edited by
      #2

      @NotYourFan Hi,

      Add "start of line" and "end of line" symbols in your regex

      ^(\d*[.]?\d*)$
      
      1 Reply Last reply
      5
      • N Offline
        N Offline
        NotYourFan
        wrote on last edited by
        #3

        @Gojir4 said in regex dont match comma:

        ^(\d*[.]?\d*)$

        lol, perfect :)

        i thank you so mutch !!!!

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by VRonin
          #4
          This post is deleted!
          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved