^.?$|^(..+?)\1+$
<answer>
Matches strings of any character repeated a non-prime number of times
Hot take: You’re shit at coding if you can’t do regex.
And then a few more any time you actually want to use it.
And then double it each time you have to decipher the existing one
Just don’t use regex unless there is really no other way, and when you absolutely have to - frankly, that’s one of the ultra rare occasions I recommend using the AI.
All my homies hate regexs. That’s actually the best use case I found for LLMs so far : I just tell it what I want it to match or not match, and it usually spits out a decent one
Oooof. I feel like trying to figure out what’s wrong with some regex I didn’t write is much harder than writing it myself personally.
Empty input Or input of exactly 1 character Or input of at least 2 characters, followed by at least 1 something (idk what \1 matches)
Did I get it (almost)?
\1 is group 1 which is inside ()
, so second part is repeated 2 or more times of 2 or more char.
It matches “yo momma”.
no