News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

EditorManager::ReplaceInFiles

Started by vmlobanov78, February 12, 2012, 04:27:08 AM

Previous topic - Next topic

vmlobanov78

In File:        sdk/editormanager.cpp
In Function:  int EditorManager::ReplaceInFiles(cbFindReplaceData* data)

From:

fileContents = cbReadFileContents(file, def_encoding);
if (fileContents.Find(data->findText) == -1)
{
continue;
}

To:

fileContents = cbReadFileContents(file, def_encoding);
if(!data->regEx)
{
if (fileContents.Find(data->findText) == -1)
{
continue;
}
}else if( AdvRegex && re.Matches(fileContents)==0)
{
continue;
}

MortenMacFly

Quote from: vmlobanov78 on February 12, 2012, 04:27:08 AM
In File:        sdk/editormanager.cpp
In Function:  int EditorManager::ReplaceInFiles(cbFindReplaceData* data)
I don't understand what you are trying to tell...?!

Can you please explain what you show here and not just post code snippets?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ptDev

Is regular expression replace in files broken?

vmlobanov78

Quote from: ptDev on February 12, 2012, 10:21:01 AM
Is regular expression replace in files broken?

Yes.

I'm from Russia. I don't speak English.

First code ("From") place - string number ~ 1980-1990 in file sdk/editormanager.cpp

Jenna

Can you tell us, what you expect and what does not work.

vmlobanov78

When I want to do "Replace in files" with options: "Regular expression" and  scope "Projects files" or "Workspace files"

In closed files does not result.
Because:
fileContents.Find(data->findText) == -1
with "RegExp" can produce results "true"