[R] Regex question

Andrej Kastrin andrej.kastrin at siol.net
Sat Jan 28 21:54:34 CET 2006


Dear R useRs,

is there any simple, build in function to match specific regular 
expression in data file and write it to a vector. I have the following 
text file:

*NEW RECORD
*ID-001
*AB-text

*NEW RECORD
*ID-002
*AB-text
etc.

Now I have to match all ID fields and print them to a vector:
001
002
etc.

I know that this is very simple with Perl or R-Perl interface, but if 
possible, I want to do that 'on the hard way'.

Cheers, Andrej




More information about the R-help mailing list