Closed BlairCooper closed 11 months ago
@BlairCooper, I've tagged you about this in two previous issues (#501 & #500). Can you respond to those?
@BlairCooper, sorry I missed your previous response in the other thread.
For this PR, the regex isn't working if the id is a negative number. I don't want to discourage you here if you're passionate about continuing a home-grown regex. But I think the two-step approach (of strsplit()
and readr::read_csv()
) will be more robust to most of these corner cases.
Screenshot of REDCap designer:
String for test cases: https://github.com/OuhscBbmc/REDCapR/blob/982662bddd7f788d52d8b0ac06bccdf4fedcde58/tests/testthat/test-metadata-utilities.R#L37
@BlairCooper, it sounds like you're ok with the approach of #504, so I'm closing this PR. Please tell me if I'm wrong. I've moved this PR's new scenarios to the list of tests.
fixes #501
Modified pattern_checkboxes regular expression to allow for case where there is no space in front of the pipe character in the Lookbehind and Lookahead expressions, and allow the space(s) after the comma to be optional.
Created test case to verify correct handling when a checkbox options has a trailing newline.
Created test case to verify correct handling when the space is missing after the comma for an option.