5

I got a numeric list. One number per line. I want to replace all numbers with a specific pattern. For example, my file look like this:

1
2
3
4

I want to replace it so as to look like the following using a regexp in Notepad++:

[1],
[2],
[3],
....
1
  • Of course. But I could not caught regexp return value. How can I catch? is index number using $1?.. Commented Apr 30, 2011 at 9:46

1 Answer 1

11

Find what:

([0-9]+)

Replace with:

[\1],
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. But Should I write regexp in ( )
You could also drop the () and use [\0], instead.
@Tim Pietzcker Nice one, didn't think of that :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.