Skip to content

Commit

Permalink
bugfix: modify the regex to allow dash
Browse files Browse the repository at this point in the history
previous regex assumed alphanumeric series IDs and does not anticipate those with '-' character such as 'PCU11331-11331-'. Added dash character to regex as fix.
  • Loading branch information
bikeactuary authored Feb 4, 2022
1 parent 526cddf commit 021f677
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/blsAPI.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down

0 comments on commit 021f677

Please sign in to comment.