@jik
If the ([^ \t]) matches a \n, then the regex engine will have already moved past it, so even though you've got the /g option that particular \n won't match the first character of your regex? But when you pass it back in on the next loop it will?
Basically, "because \n\n is possible".
This feels like a situation where one of those extended regex attributes that means something like "match but don't consume" might do the trick for a single pass solution, but I never learned those. 😁
=> More informations about this toot | View the thread | More toots from jztusk@mastodon.social
=> View jik@federate.social profile
text/gemini
This content has been proxied by September (ba2dc).