[R] Extracting part of alpha numeric string

Abhinaba Roy abhinabaroy09 at gmail.com
Mon Nov 30 11:39:20 CET 2015


Hi,

I have a field with alpha numeric codes like,

2154333b-3208-4519-8b76-acaef5b5a479 980958a0-103b-4ba9-afaf-27b2f5c24e69
00966654-0dea-4899-b8cf-26e8300b262d
I want a derived field which will contain ONLY the numeric part before the
first alphabet and the first '-',

for example the derived field from the sample above will give me

2154333
980958
00966654

How can this be achieved in R?

P.S. I do not have much knowledge on regex. It would be of great help if
you could suggest some reading for beginners.

Thanks,
Abhinaba

	[[alternative HTML version deleted]]



More information about the R-help mailing list