I tried to use the regexp (?<=^(?![ \t]*@).+)(?<![\{\};:)]|//.{0,1024}|^[ \t]+)\R
to:
- Match newlines without matching preceding characters
- Don't match newlines in only-space lines (empty lines)
- Don't match newlines in lines started by optional spaces (not newlines) and at-symbol '@'.
- Don't match newlines in lines containing [unescaped] '//'.
- Don't match newlines preceded by '{', '}', ';' or ':'. (better if doesn't match newlines preceded by optional spaces and that characters.)
That regexp worked in Eclipse search, but I cannot replace the match because an Eclipse find-and-replace bug. Then I tried it in Notepad++ and in TextPad, but they told me that the regexp is malformed. I tried to validate the regexp in a online regexp validator and said me the regex has errors.
How do I construct a correct regexp that satisfy those listed requirements?
has to match the new line.
has to match the new line.
has to match the new line
doesn't have to match the new line;
doesn't have match the new line {
doesn't have to match the new line}
doesn't have to match the new line:
doesn't have to match the new line //because of this
@doesn't have to match the new line
h@s to match the new line-