How to use regex with replace in Notepad++

I have a csv file with fields in format given below ...

ram(tower)america
shyam(t.nagar)japan
john(jam nagar)netherland

i want to change this in format given below

ram","america
shyam","japan
john","netherland

How can i do this in Notepad++ with regex

1

2 Answers

Open 'Find and Replace' dialogue box with Ctrl+H in Notepad++. Write the following:

  • Find what: \(.+?\)
  • Replace with: ","

Syntax used:

  • Backward slash and left brace: Find left brace
  • Single dot and plus sign: Matches any character
  • Backward slash and right brace: Find right brace

Notepad++_Find_and_Replace

Further reading:

In the Notepad++ find/replace dialogue:

  • Find what: (.*?)\(.*\)(.*)

  • Replace with: $1","$2

Here is the screenshot of Notepad++ find/replace dialogue window:

Notepad++ find/replace dialogue window screenshot

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like