[Solved] Qt Creator search: Regular expressions



  • Two of the regular expressions I need most for search are "match any string" and "match any one character".

    I always fall into that trap when I enter a search term such as
    @void set*(const bool *);@
    ...and actually expected them to find something.

    Of course, there is the complete documentation of QRegExp, but I am sorry to say that these very basic regular expressions are buried somewhere in the pages of dozens of other expression terms.

    For matching any single character, I need to use the .(dot), I found out.
    But I cannot seem to find a working "match any string" term. I though it must be [^.], but that does not work as expected.

    Edit: Found it.
    Match single character: .
    Match any string: .*


  • Lifetime Qt Champion

    Hi,

    .* is match any character any number of time including zero. This might not be what you want, be careful



  • Yes, this is what I want. Thanks for clarifying.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.