Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to find two or more (max 9) white-space characters and replace it with newlines.

My RegEx syntax is as follows:

[\s]{2,9}

However, Notepad++'s RegEx doesn't seem to work with curly braces. When I use plugin RegEx helper, it highlights proper values, using above syntax. It doesn't, however, replace the found values.

What am I doing wrong?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

I found no reference to curly-based occurence numbering in Notepad++ regexp documentation.

Then you should to it the hard way:

\s\s\s?\s?\s?\s?\s?\s?\s?
share|improve this answer

Notepad++ does not support explicit quantifiers:

You can, however, use the following quantifiers:

  • k*, which is equivalent to k{0,}.
  • k+, which is equivalent to k{1,}.
  • k?, which is equivalent to k{0,1}.
share|improve this answer
1  
No, \s is "always" a character class. So [\s] is the same as \s. –  Ouki Feb 14 '12 at 13:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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