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)?
Post funny things about programming here! (Or just rant about your favourite programming language.)
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.
Interesting.
So that means match any string that is made entirely of a single repeating sequence, where repititon is possible.
The pipe is throwing me off because usually I have to do parentheses for that to work...
I could be wrong but I think the (..+?)
portion will either remove a dud or replenish the allowance.
It matches for non-primes and doesn't match for primes.
Looks like APL to me.
It matches “yo momma”.
I'm I the only one who pronounces regex with a soft g? Hard g feels so clunky
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
That sounds…
Easier to get almost right than actually learning the subject.
Much, much harder to get completely right than actually learning the subject.
So yes, basically the archetypal use case for LLMs.