I’m trying to write a regex substitution for markup-ish text. I try to catch every line that is not empty and does not start with any number of hashtags.
I tried to catch just the content using the negative lookbehind assertion so find lines that start with any number of hashtags followed by a space.
Here is what I tried with a negative lookbehind:
/^(?<!#+ )(.*?)$/i
My searched text looks similar like this:
# heading
## part
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
## part
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet
I get the error invalid pattern in look-behind
, and I don’t understand it. Could you help me?