I have a document that is 10,000 lines long. I would like to remove all lines that are 3 letters or less, excluding any lines that start with a § symbol or excluding any lines that are all in caps.
Example: Before removal:
§day
DOG
Happy
Monday
Now
Yes
Sunday
§new day.txt
DIY
Leg
Books
Car
Home
After removal:
§day
DOG
Happy
Monday
Sunday
§new day.txt
DIY
Books
Home
DOG & DIY are not affected as they are all capitals.
The lines start with § are also not affected.
My attempts
I know that this code can be used to make Regex ignore all lines that are in capitals and all lines that start with a § (In the example, the code is searching for many or north or one).
(^(?:(?:§.*|[^[:alpha:]\n\r]*[[:upper:]]+(?:[^[:alpha:]\n\r]+[[:upper:]]+)*[^[:alpha:]\n\r]*))$|(?i:\b(?:many|north|one)\s+of\b))|(?i:\bof\b)
I also know that this code can be used to find all words that are 3 letters or less
'^.{1,3}$'
Is there any way I can combine them?
I tried replacing many|north|one with '^.{1,3}$' but it didn’t work.



