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. Help in constructing a QRegExp
Forum Update on Monday, May 27th 2025

Help in constructing a QRegExp

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 762 Views
  • 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.
  • T Offline
    T Offline
    tesmai4
    wrote on 19 Nov 2013, 16:23 last edited by
    #1

    I want to remove ".bmp" from my file name using QRegExp. My file name is formatted as "Alphanumerics.bmp".
    Could someone help me with constructing QRegExp for this?

    How can I use QRegExp for removing a part of QSting ?

    Regards,

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 20 Nov 2013, 08:33 last edited by
      #2

      @
      QString mystring("alphanumerics.bmp");

      mystring.replace(".bmp", "");
      @

      Done :) No need for regexp here. Alternatively, you can get the extension using QFileInfo::suffix().

      (Z(:^

      1 Reply Last reply
      0

      1/2

      19 Nov 2013, 16:23

      • Login

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