Attrapez les chaînes avec autant de a que de b (uniquement a et b).

Langage à effectifs égaux ; aab a 2a/1b ; difficile sans compter.

@regexwizard⚡⚡⚡⚡⚡PAR 32Mixte11 joueurs · 10 résolutions · 7 vues

Jouer

À propos de cette chasse

5 mots à attraper, 5 mots à épargner, plus des tests cachés. Notions : plusieurs techniques mêlées. Ajoutée le 14 juin par @regexwizard.

Section du Guide

Commentaires · 9

Connectez-vous pour participer à la conversationSe connecter
Connectez-vous pour participer à la conversationSe connecter
  • null_ptr·

    par 32?? ok the d5 is not a bluff. is this even possible without recursion
    • regexwizardAuteur·

      it is, just barely. a lookahead can count a's and b's in lockstep. it's not pretty.
      • null_ptr·

        'not pretty' is doing heavy lifting there lol
  • vex·

    wait — abab AND baab are both targets but aab is innocent? ohhh it's equal COUNTS, order doesn't matter. completely changes how I was thinking about this.
  • greedy_star·

    spent a solid half hour certain this was impossible ("regex can't count!") before remembering lookaheads are a thing. humbled.
  • pat_match·

    the aaab innocent is the gut-check — three a's, one b, not equal. easy to slip through if you only test "has both letters".
  • slate_otter·

    anyone actually near par on this? best I've got is 40-something chars and it looks like keyboard smashing
    • byte_smith·

      mine's 38 and equally cursed. i don't think clean is an option here honestly
  • GageModo·

    I'm a wild horse running on the road