News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Please help with Regular Expressions in search dialog

Started by muman, April 11, 2009, 02:03:26 AM

Previous topic - Next topic

muman

Hello,

I am really trying to enjoy the Code::Blocks experience. I just gave a demonstration of Code::Blocks to the managers of my company. There are a couple of features I really wish that Code::Blocks supported.

Firstly I would like to understand how to use the regular expressions feature of the find/replace dialog.

I have lines like this:

<tt>
    reglist.push_back(std::pair<string_t,unsigned int>("a1",debugcontext[ADDR_A+1]));
</tt>

and I want to replace the "a1" with _T("a1") in order to make my application compile for Unicode builds.

I played with the regex plugin and came up with the following regex:

"a[0-9]" which matched my example cases but I need to be able to store this pattern and put it into the replacement text

like

s/(\"a[0-9]")/\_T\(\1\)/g

Is there any documentation on this feature? I have done extensive searching on google for this and came up empty handed today.

I also lament the lack of CVS integration of Code::Blocks... My company has a requirement that the IDE is integrated with the CVS so that we can checkout/checkin/diff against repo... I explained that a plugin 'could' be written to do it... But my company will not take on that project.

muman

Ok... I figured it out... Sorry...

It worked like this

\("a[0-9]"\)

replace with

_T(\1)


Calmarius

#2
There should be a documentation about the regex flavour C::B using.

There are a lot of regex flavors and its tedious to try out all.

dmoore

It's the wxWidgets version. (See my sig for a link.)

Admonition: Better to start new threads than open up old ones.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]