Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-92393

Qmake contains() regex is not matched

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.12.7
    • Fix Version/s: None
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      The following minimal example is used to trigger actions by a HEADER matched by a filter string.

      However, the regex

       .*$$filter.*

      does not work, where it should match the suffix 

      .h

      If I try explicitely 

      .*$$filter\..*

      to escape only the dot, the remaining 

      h

      is again matched correctly.

      Is this a bug, or how can I form that regex to match any characters after the filter string?

      HEADERS += foo.h bar.h
      
      FILTER = foo bar
      
      for(header, $$list($$HEADERS)) {
      	for(filter,$$list($$FILTER)){
      		message(header: $$header)
      		message(filter: $$filter)
                      contains(header,.*$$filter.*){      # does not work
      		# contains(header,.*$$filter\..*){ # works
      			message(match)
      		}
      	}
      }
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            darkmattercoder Jochen Bauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes