From 021f677d2a6a6d538859b97455cd72a3663f415b Mon Sep 17 00:00:00 2001 From: bikeactuary Date: Fri, 4 Feb 2022 14:28:38 -0500 Subject: [PATCH] bugfix: modify the regex to allow dash previous regex assumed alphanumeric series IDs and does not anticipate those with '-' character such as 'PCU11331-11331-'. Added dash character to regex as fix. --- R/blsAPI.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/blsAPI.R b/R/blsAPI.R index de59be1..bc18c92 100644 --- a/R/blsAPI.R +++ b/R/blsAPI.R @@ -70,7 +70,7 @@ blsAPI <- function(payload=NA, api_version=1, return_data_frame=FALSE){ if (is.list(payload)){ # Multiple Series or One or More Series, Specifying Years request payload <- toJSON(payload) - m <- regexpr('\\"seriesid\\":\\"[a-zA-Z0-9]*\\",', payload) + m <- regexpr('\\"seriesid\\":\\"[a-zA-Z0-9-]*\\",', payload) str <- regmatches(payload, m) if (length(str) > 0){ # wrap single series in []