I'm working with the Notepad++ flavour of regex. This...
Find: ([^`]{1,23} )
Replace: $0\n
...takes this input string...
Now is the time for all good men to come to the aid of the party.
...and produces this output string:
Now is the time for all
good men to come to the
aid of the party.
It splits the string into lines of 24 or fewer non-backtick (`) chars, splitting after spaces. It only works if the final character of the input string is also a space character.
This string...
Now is the time for all good men to █come to the aid█ of the party.
...splits differently.
Now is the time for all
good men to █come to
the aid█ of the party.
I'm looking for a way to skip over the █ characters - to process the input string as if the █s were not there.
[Notes: ` (backtick) characters are reserved to enclose text formatting tags, to be inserted later. █ characters will be used to mean "this bit of text will have tags inserted later", so they will be clensed, but not yet. I'm using █ (full block) to represent the Unicode 7F (del) character here, because 7F doesn't display properly. I can also use Perl flavour regex in AHK, if absolutely necessary.]
These regex patterns finds fail to ignore █:
(([^`]|█?){1,23} )
((([^`])|(█)?){1,23} )
((([^`])|(?:█)){1,23} )
So, is there a way to do this?