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. How to check wether a Qstring is alpha numeric
Forum Updated to NodeBB v4.3 + New Features

How to check wether a Qstring is alpha numeric

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 7.1k Views 1 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.
  • I Offline
    I Offline
    Indrajeet
    wrote on last edited by
    #1

    Hi

    I am using regexp in which I am alowing charactes A-Z,a-z,0-9 & special characters like '-' & '_'
    But the problem is if the user sends the string as

    @
    "----------" or "_________"
    @

    so how to handle such things.

    [EDIT: code formatting to trick out the formatting engine, Volker]

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      If you allow "-" and "_" as valid characters then I would regard

      @
      QString x = "-----------";

      QString y = "_________";
      @

      as valid strings too.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Indrajeet
        wrote on last edited by
        #3

        Hi volker

        how to check that string should contain atleast one char,one number & one special character.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          GentooXativa
          wrote on last edited by
          #4

          Use QRegExp, check this "post":http://www.zorched.net/2009/05/08/password-strength-validation-with-regular-expressions/

          I hope this help you :)

          Jose Vicente Giner Sanchez - Senior Mobile Developer

          www.gigigo.com

          C/ Dr. Zamenhof 36bis, 1ºA 28027 Madrid
          T: +34 917431436

          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