Andrewcinebox@masto.hackers.town
Oct 13, 2026, 1:36 AM#regex question
how do I capture a pattern as long as it does not catch another pattern
In other words, how do I not capture the rows that are dashes here
#regex question
how do I capture a pattern as long as it does not catch another pattern
In other words, how do I not capture the rows that are dashes here
I guess I can just run a second match
@cinebox Honestly, unless you're using one of the "fancier" (actually more regular) engines that can do regex intersection and negation, it's probably more readable to parse the general structure first and filter out dash lines in a separate pass. Cramming it all into a single regex with negative look-ahead and the like quickly gets unreadable (unless you use something like Perl that allows sane formatting/indentation/comments within regexes, but I'd still do two passes there).