stopifnot(glob2rx("abc.*") == "^abc\\.",<!-- % '\\' doubled in Rd file! -->
glob2rx("a?b.*") == "^a.b\\.",
glob2rx("a?b.*", trim.tail = FALSE) == "^a.b\\..*$",
glob2rx("*.doc") == "^.*\\.doc$",
glob2rx("*.doc", trim.head = TRUE) == "\\.doc$",
glob2rx("*.t*") == "^.*\\.t",
glob2rx("*.t??") == "^.*\\.t..$",
glob2rx("*[*") == "^.*\\["
)
Run the code above in your browser using DataLab