I tried using regexp (?<=^(?![ \t]*@).+)(?<![\{\};:)]|//.{0,1024}|^[ \t]+)\Rfor:
- Matches newlines without matching previous characters
- Newline lines do not match only in lines (empty lines)
- Do not match newlines in lines starting with optional spaces (not newlines) and the "@" character.
- Newline does not match in lines containing [unescaped] '//'.
- Do not match newlines preceding '{', '}', ';' or ':'. (better if it does not match newline characters preceded by extra spaces and characters).
This regex works in Eclipse search, but I cannot replace it because the Eclipse find-and-replace error. Then I tried it in Notepad ++ and TextPad , but they told me that the regex is distorted. I tried to test the regex in the regexp online validator and said that the regex has errors.
How to create the correct regular expression satisfying the 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-
source
share