-1

The dragon book, exercise 3.3.10 The UNIX shell command .sh uses the operators in fig 3.9 in filenames expressions to define sets of file names. For example, the file name expression *.o matches all file names ending in .o; sort1.? matches all file names of sort.c, where c is any character. Show how sh filenames expressions can be replaced by equivalent regular expressions using only basic union, concatenation and closure operation

enter image description here

So what is the difference between string literall and any string? I though String literal was anything like s = "blabla" with the /n in the last position. It also comes to the character, what it actually meant when said character c literally and any character.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
Bruno Braga
  • 570
  • 2
  • 4
  • 13

1 Answers1

0

You may be overthinking this, but it's mostly self explanatory. Literally means exactly that. So "s" means _exactly the string s.

Contrast this with any string, *. This means that it could be s, but it could also be a, ss, whatever string you want, or nothing at all.

Any character or ? can be any single character like a, s, or c, but not ss because that is more than one character.

Explosion Pills
  • 188,624
  • 52
  • 326
  • 405