Hello,

i am trying to parse the HEADERS and SOURCES section of a Qt project file.
Given the following content:

Qt Code:
  1. SOURCES += \
  2. ../Source/Test1.cpp \
  3. ../Source/Test2.cpp \
  4.  
  5. win32 {
  6. SOURCES += \
  7. ../Source/Test.cpp
  8. }
To copy to clipboard, switch view to plain text mode 

When searching with a regular expression, the matched result should be this:

SOURCES += \
../Source/Test1.cpp \
../Source/Test2.cpp \

The other SOURCES block should not be part of the result, cause it is wrapped in a {} block.

My base expression, which will match both is this, it works fine for the tests i have done.

Qt Code:
  1. SOURCES\s+(\+=|=)(\s+(.+\.cpp)?\s*\\?){0,}
To copy to clipboard, switch view to plain text mode 

Then i tried to exclude the second block by appending

Qt Code:
  1. \s*(?!\})
To copy to clipboard, switch view to plain text mode 

but this did not work as expected (changed nothing).

I am testing the expression using this side http://gskinner.com/RegExr/

Does anyone have an idea why this does not work?