this post was submitted on 25 Apr 2026
33 points (100.0% liked)

Self-hosting

4324 readers
6 users here now

Hosting your own services. Preferably at home and on low-power or shared hardware.

Also check out:

founded 4 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] cravl@slrpnk.net 1 points 2 weeks ago (1 children)

Replacing line breaks with nulls first is an option. That's a lot of extra processing for very large blocks of text though.

Using regular grep is possible with the right flags, or you could also use pcre2grep with the -M flag, which should be available on every distro nowadays. See this Stack Overflow article for details.

[–] activistPnk@slrpnk.net 1 points 2 weeks ago* (last edited 2 weeks ago)

pcregrep is not automatically installed with Debian but it’s in the official repos. It seems common to get:

pcregrep: Too many errors - abandoned.
pcregrep: Error -8, -21 or -27 means that a resource limit was exceeded.
pcregrep: Check your regex for nested unlimited loops.

But it will help in many cases. I can see that it works on sufficiently small files. I noticed the built-in grep function for emacs can be modified to use pcregrep w/-M added instead of grep, which I find quite important because emacs makes it very easy to jump around to visit different results. In the end it’s still a hack.