Displaying 1 result from an estimated 1 matches for "alan334".
2006 Mar 25
7
Regexp subexpression
...they
are in sequence.
Do I really have to use the sub twice, first extracting the first variable,
then the second? The third example should return nothing, because it's
inverted, but it returns the whole string. I know I could check that
separately, but is there no better way?
patid=c("ALAN334","AzD44","44AZD")
txt =sub("([[:alpha:]]+)([[:digit:]])+","\\1",patid)
num =sub("([[:alpha:]]+)([[:digit:]])+","\\2",patid)
It would be nice if the following data frame would be returned:
txt num
ALAN 334
AzD 44
NA...