I'm reasonably new to Notepad++ and regular expressions, I'm really struggling to solve this issue


?:?[??][??] -> where numbers can be anything

I've tried using the Find:

  • Find (:)|(])
  • Replace (][)|(->connectedwaypoints.push_back)

This doesn't seem to work

below is my desired result.



? can be any given number, I want to not replace the numbers, but everything else.

  • @McDonald's my expected format / outcome is WarpPoints[0]->paths_connected[6]->connectedwaypoints.push_back(HiFiWaypoints[105][56]); – RNewell122 Aug 29 '17 at 2:00
  • @McDonald's Thats ok, do you have any idea how ? – RNewell122 Aug 29 '17 at 4:31

Try to find:


And replace with


And the search mode should be "Regular expression".


  • For the find part, [0-9] means any digits, \[ and \] means to match any [ and ] respectively. ( and ) will make anything inside the parenthesis referred in "replace with " as \1 \2 etc.

  • For the replace with part, it is pretty self-explanatory, where \1 is the contents within the first pair of parenthesis, \2 being the contents within the second pair, etc.

Please Google on "regular expression" if you are not sure what the other symbols means.

  • That worked thanks! I was trying to do it bit by bit, and was taking a long time forgot \ is often used in many languages to [ use symbols, thats where I was going wrong. – RNewell122 Aug 29 '17 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.