To only grab four digits
age = regexp(CharData,'(\d{4})','match','once')
Doing d{1,4}
means look for numbers with a length between 1 and 4. Meaning, 1
, 29
, 123
, 4444
would all match because their length is between 1 and 4
d{4}
says, get me the number with exact length of 4. Meaning, 1997
, 2001
, 1800
would all match.