I want to check if a string has either this format "1234.34" or this "1234". I tried the following using grepl in R (1 or more numbers, a dot or not followed by more numbers):
grepl("([[:digit:]]+\\.?[[:digit:]]*)", c("1234.34", "1234,34", "1234"))
# [1] TRUE TRUE TRUE
With 1234.34 or 1234 it works fine (both TRUE).
If I test "1234,34" (with "comma"), the expression becomes TRUE, but I expected FALSE.