• Telorand@reddthat.com
      link
      fedilink
      arrow-up
      3
      ·
      3 hours ago

      Yes, but you can really only do that with single characters, since your first example is an ordered group and the second is an unordered set in a capturing group. The equivalency drops off when you include more characters.

      Plus, you can do things like [a-zA-Z], and you can’t do that with the former example.

      I would imagine there’s a difference in computing overhead, too, but I have no idea which is more performant.