Comment

Comment by cmdlineluser

Not sure if it would be considered simpler but lookaheads can be used to express it in a single pattern.

    ^(?=.{8}k.$)(?=[^a]*a[^a]*$)(?=[^b]*b[^b]*$)(?=[^c]*c[^c]*$)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton