I have a variable x that is a series of characters such as:
"W1W", "BT3", "BS5", "E1W", "B68"
From this I need to extract the characters before the first numeric character to get e.g.
"W", "BT", "BS", "E", "B"
I have tried looking through previous questions and found:
gsub("[^a-zA-Z]", "", x)
but this keeps the text characters following the numeric character and results in:
"WW", "BT", "BS", "EW", "B"
Is there any way to get only the leading text characters before the numeric character and drop everything afterwards?