bool PHPEditorContextMenu::IsIncludeOrRequireStatement(wxString& includeWhat) { // Do a basic check to see whether this line is include statement or not. // Don't bother in full parsing the file since it can be a quite an expensive operation // (include|require_once|require|include_once)[ \t\\(]*(.*?)[\\) \t)]*; static wxRegEx reInclude(wxT("(include|require_once|require|include_once)[ \t\\(]*(.*?)[\\) \t]*;"), wxRE_ADVANCED); IEditor* editor = m_manager->GetActiveEditor(); if(!editor) return false; wxString line = editor->GetCtrl()->GetLine(editor->GetCurrentLine()); if(reInclude.IsValid() && reInclude.Matches(line)) { includeWhat = reInclude.GetMatch(line, 2); return true; } return false; }