Results 1 to 2 of 2

Thread: Define a QRegExp containing arithmetic operators

  1. #1
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Define a QRegExp containing arithmetic operators

    Is there a way to define a QRegExp containing all arithmetic operators in a single expression? I am able to do it individually , like for operator + as QRegExp rx("\\+");.. I want to define a single regular expression containing all arithmetic operators. Is it possible? Can anyone help me with this?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Define a QRegExp containing arithmetic operators

    It may be possible but you will have to define "all arithmetic operators". The operators for FORTRAN are different from those for COBOL or Java. You might use a character class and/or alternation.

    Rather than starting a new thread for every single regular expression you want to create (1, 2, 3) I suggest your find yourself a good book or online tutorial on the topic and learn how regular expressions work. The QRegExp docs are not devoid of merit either. There are plenty of tools out there to help your experiment with regular expressions without coding.

Similar Threads

  1. Define a QRegExp using angular brackets <>
    By aaditya190 in forum Newbie
    Replies: 2
    Last Post: 4th December 2013, 08:18
  2. Define a QRegExp
    By aaditya190 in forum Newbie
    Replies: 8
    Last Post: 2nd December 2013, 06:29
  3. Stuck creating << and >> operators for my custom class.
    By agerlach in forum Qt Programming
    Replies: 12
    Last Post: 3rd January 2011, 21:44
  4. Replies: 3
    Last Post: 16th December 2010, 14:02
  5. QDataStream class/struct & stream operators
    By darksaga in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2008, 19:40

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.