2013-01-23 42 views
1

我需要構建一個匹配通用#include "file.h"代碼行的表達式。Boost.Regex表達式構建

以下是否正確?

([[:blank:]]*#include[[:blank:]]*")([[:print:]]*\.h)([[:print:]]*) 

表達應匹配以下內容:

#include  "header.h" //first include 

    #include "header2.h"  //second include 

#include "header3.h" 

我使用boost regex庫。

+1

http://www.regextester.com/試試看...... – Caribou

+0

@Caribou - 謝謝! – Yakov

+0

你能解釋一下我需要什麼方言嗎? – Yakov

回答