Author Topic: Please help with Regular Expressions in search dialog  (Read 10112 times)

Offline muman

  • Single posting newcomer
  • *
  • Posts: 2
Please help with Regular Expressions in search dialog
« on: April 11, 2009, 02:03:26 am »
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.

Offline muman

  • Single posting newcomer
  • *
  • Posts: 2
Re: Please help with Regular Expressions in search dialog
« Reply #1 on: April 11, 2009, 02:08:33 am »
Ok... I figured it out... Sorry...

It worked like this

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

replace with

_T(\1)


Offline Calmarius

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Please help with Regular Expressions in search dialog
« Reply #2 on: June 08, 2012, 09:59:54 am »
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.
« Last Edit: June 08, 2012, 10:05:17 am by Calmarius »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Please help with Regular Expressions in search dialog
« Reply #3 on: June 08, 2012, 05:26:59 pm »
It's the wxWidgets version. (See my sig for a link.)

Admonition: Better to start new threads than open up old ones.