0

I have a requirement to replace all the below numbers to TAB in text Editors like notepad++. I tried the below regular expression but it still needs some manually work. Can anyone help to achieve this in single regular expression.

I used the below one and manually removed the [1-9]. factor to get all the lines.

\<3.1.[1-9].[1-9].[1-9].

3.1. Cre
3.1.1. Im
3.1.1.1. O
3.1.1.2. Ce
3.1.1.3. Part
3.1.2. ED
3.1.2.1. Ow
3.1.2.2. ED
3.1.3. OF
3.1.3.1. O
3.1.3.2. O
3.1.3.3. O
3.1.3.4. O
3.1.4. Sc
3.1.5. In
3.1.6. Vi
3.1.7. Bu
3.1.8. Ho
3.1.8.1. Ou
3.1.8.2. In
3.1.9. Pa
3.1.9.1. Re
3.1.9.2. Re
3.1.9.3. Pr
3.1.9.3.1. Ou
3.1.9.3.2. Sp
3.1.9.3.3. In
3.1.9.3.4. In
Delimitry
  • 2,987
  • 4
  • 30
  • 39
Pallab
  • 687
  • 1
  • 7
  • 15

2 Answers2

1

Search for

^3[.1-9]+\s

and replace with

\t

It works in NotePad++ on my computer.

UPDATE: A more generic regex in NotePad++ for bullet point removal:

Search: ^[.0-9]+\s([A-Z])

Replace with \t\1

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
1
^3(?:\.\d+)*\.\s*

Try this.See demo.

https://regex101.com/r/wU7sQ0/39

vks
  • 67,027
  • 10
  • 91
  • 124
  • I tried it in notepad++ it its not able to find the regex, may be what you mentioned is for some other programming language – Pallab Mar 02 '15 at 11:07