Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to Bookmark Normal and Decimal Percentage Numbers in Notepad++?

I’m trying to bookmark lines that contain percentage numbers in Notepad++. Specifically, I want to bookmark both whole number percentages (like 9%) and decimal percentages (like 4.5%).

for example I have following list:

VitrtertWW
44.98%
Liertertde
32.52%
Ltettth
Ltertrth9%
Mhrhrththw
4.5%
1992Q2
/////////////////////////

I want to move all percentage numbers to next line.
following regex is working good:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Find: \d+\.\d+%
Replace: \n$0

but my regex have a problem. It just move decimal percentage numbers to next line and normal percentage numbers not move to next line.
how to fix this problem?

I tried following regular expressions too but not working:

(?<!\d)\d%(?!\d)
(|\s)\d%(\s|$)

>Solution :

It just move decimal percentage numbers to next line and normal percentage numbers not move to next line.

That’s because your find pattern demands that there is a dot and digits after it. Simply make that part of the pattern optional:

\d+(\.\d+)?%
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading