0

I am trying to convert my html document to asciidoc. But result lines have weird + signs like these:

++

+
Mandatory Relationship
+


* *many-to-many* – because databases don’t support this kind of
relationship, it is physically implemented via a *third junction table*
using *one-to-many* relationships.
+

+

I want to delete these lines using notepad++ regex. I tried the following:

^+$

^ and $ are anchors specifying the beginning & end of the line and I put + sign between them.But this regex doesn't work. Any advice appreciated.

  • + is a special character (repeat previous one or more times), so you need to escape it by searching for ^\+$. – AFH Nov 3 '18 at 19:34
  • Thanks but this regex doesn't delete lines which contain +++,++++.I tried ^.*\+$ but this regex deletes some contents of the file which contains + sign. – my-lord Nov 3 '18 at 19:52
  • 2
    Your question is confusing - the title is delete lines which contains only + sign, which is what I addressed. To match multiple + signs, you also need the special meaning of +, so search for ^\++$. – AFH Nov 3 '18 at 19:54
  • (I've corrected your title.) – AFH Nov 3 '18 at 20:02
0

I think the regex you're looking for is

^\++$

The \+ escapes the + sign, and the second plus searches for one or more occurence

EDIT: saw it after posting, Delete lines which contain only + signs already answered in comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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