Skip to content

Commit

Permalink
fix: #7 parse_packageId() should also check for dashes in recognizing…
Browse files Browse the repository at this point in the history
… EDI packageId pattern
  • Loading branch information
atn38 committed Apr 5, 2022
1 parent 243914c commit 508ad4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ null2na <- function(x) {

parse_packageId <- function(full_id) {
stopifnot(is.character(full_id), length(full_id) == 1)
if(!grepl("[^A-Za-z0-9 .]", full_id) && # check that string only has A-Z, a-z, numeric, and periods
if(!grepl("[^A-Za-z0-9 . -]", full_id) && # check that string only has A-Z, a-z, numeric, dashes, and periods
nchar(gsub("[^.]", "", full_id)) == 2 && # check that string has exactly two periods
!startsWith(full_id, ".") && # doesnt start with a period
!endsWith(full_id, ".") # doesnt end with a period
Expand Down

0 comments on commit 508ad4d

Please sign in to comment.