-3

The regexp | seems to match everything that's empty. my best guess at an interpretation of the regexp | is that it's saying: match either "nothing" or "nothing". So it ends up matching every zero-length spot in the string. Would this be the correct interpretation?

Some sample Go code using this regexp that shows what I'm talking about: https://play.golang.org/p/5JzeMkuMcnr

Xornand
  • 170
  • 1
  • 5

1 Answers1

-1

Yes, the empty regex matches 0 characters at any position, and the regex | is just the alternation of two empty regexes, which is the same thing (since the first branch of the alternation trivially matches).

hobbs
  • 187,508
  • 16
  • 182
  • 271