a propper diagnosis in my data can have the format:
"F10"
"F10.1"
"F32.124"
I try to extract these correct format within a for loop:
Diagnosen[i] <- str_extract(Diagnosen[i], pattern = "F[:digit:]{2}[\\.[:digit:]{1,3}]?")
But the results are cut off after the point. Exp:
"F10."
what is not a correct format and lost information.
My pattern shall mean: Find the string beginning with an F and 2 digits. Optional is a point with one to three digits.
Please help me. Best Sebastian