Skip to content

.path_to_pos() fails when path contains regular expression symbols #1058

@rmao6

Description

@rmao6

The code at https://github.com/insightsengineering/rtables/blob/main/R/tt_pos_and_access.R#L995 can't match paths that contain regular expression symbols like +. For example:

pathregex <- "gear + carb"
pathstrs <- c("gear + carb`3 + 1", "gear + carb`3 + 2")
grep(pathregex, pathstrs)

# integer(0)

Adding fixed = TRUE to grep() seems a solution, but it would affect the function of character *.

See also johnsonandjohnson/junco#100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions