1
  • In Notepad++ * stands for an arbitrary string and . for one arbitrary character (optionally including newlines).
  • In the Linux console * stands for an arbitrary string and ? for one arbitrary character.
  • In SQL % stands for an arbitrary string and _ for one arbitrary character. But only in string matching, in selection of columns * matches everything.

I've heard about even more different systems like this and I didn't even start on more complex selections. I can't even use the same regular expressions that work in Notepad++ in its Linux clone, NotepadQQ.

My question: How did regex develop to be like this? Were there multiple separate, parallel developments that just turned out to be similar, except using different characters? Or did it start with one standard and then in different situations different commonly used characters got avoided (like . in the console being used for file extension separators)?

  • 4
    Those aren't even regular expressions, they're wildcards or globs. Unfortunately, the two are hard to tell apart because they were all invented for the same extremely restricted 7-bit character set in the '70s. – Kilian Foth Jan 15 '19 at 11:27
  • Ok, then the question applies similarly for those: Once it's * and ?, once % and _, sometimes also other characters. – Fabian Röling Jan 15 '19 at 11:30
  • 2
    @FabianRöling: The most probable answer is that wildcard matching was designed by multiple independent teams. Each team will make their own choices which character to use as wildcard characters. – Bart van Ingen Schenau Jan 15 '19 at 11:56
  • 3
    Because of standards. – Neil Jan 15 '19 at 11:59
  • 2
    primarily opinion-based oh yes, historical facts are nowadays opinions and can be replaced by alternative facts/opinions. – Bernhard Hiller Jan 16 '19 at 13:53