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

original comic artist: thisstupidtwink@insta

  • expr@piefed.social
    link
    fedilink
    English
    arrow-up
    10
    ·
    3 days ago

    Traditionally, the global flag is used to mean global within a line, meaning all matches in a line.

    • NaibofTabr@infosec.pub
      cake
      link
      fedilink
      English
      arrow-up
      13
      ·
      3 days ago

      Right, but this expression has an explicit ^ and $, so if there’s anything else in the input line besides a single instance of the pattern, it won’t match. This makes the g kind of pointless, there can’t possibly be multiple instances of the pattern in the same line and still return a valid match.