the original said reggae but i misread it as regex and got this idea lol

original comic artist: thisstupidtwink@insta

you are viewing a single comment's thread
view the rest of the comments
[–] 5 points 4 months ago (5 children)

Never knew the repeat group bit. Can’t really think of a practical use case for it though…

  • source
  • parent
  • hideshow 5 child comments
  • [–] 4 points 4 months ago (3 children)

    I use it in Vim. Sometimes you want to rename a variable that's present multiple times in the same line

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 4 months ago

    (?:\d{3}-){2}(?:\d{4}) would match a ten digit us-format phone number, though I'd recommend using two literally instead of a repeat for maintainability reasons. Regex needs no assistance being terse and obtuse, humans need time to understand regex patterns, even ones they wrote not long ago. Make that part easier on your collaborators, and treat your past and future selves like remote asynchronous collaborators, always.

  • source
  • parent