I want to extract just FIRST TWO DIGITS from some strings. Suppose the data is :
ABC Conference Room Monitor - Z5580J ABC 19 Monitor ABC 24 Monitor f
Package stringr perhaps allows for the cleanest solution:
stringr
stringr::str_extract(string, "\\d{2}") "55" "19" "24" "24"