stopifnot(glob2rx("abc.*") == "^abc\\.", glob2rx("a?b.*") == "^a.b\\.",
glob2rx("*.doc") == "^.*\\.doc$",
glob2rx("*.t*") == "^.*\\.t",
glob2rx("*.t??") == "^.*\\.t..$")
Run the code above in your browser using DataLab