What is a flip-flop operator?
I have heard and read about flip-flops with regular expressions in Perl and Ruby recently, but I was unable to find how they really work and what the common use cases are. Can anyone explain this in a language-agnostic manner? Now that I understand what it is, and how it works, I would rephrase the question to be simply: What is a flip-flop operator? The flip-flop operator in Perl evaluates to true when the left operand is true, and keeps evaluating to true until the right operand is true. The left and right operand could be any kind of expression, but most often it is used with regexes. With