I have the following string:
x <- "\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\tGEO Publications\n\t\t\t\t\tHandout\n\t\t\t\t\t\tNAR 2013 (latest)\n\t\t\t\t\t\tNAR 2002 (original)\n\t\t\t\t\t\tAll publications\n\t\t\t\t\t\n\t\t\t\tFAQ\n\t\t\t\tMIAME\n\t\t\t\tEmail GEO\n\t\t\t\n \n \n \n \n \n \n NCBI > GEO > Accession Display\nNot logged in | Login\n\n \n \n \n \n \n \n \n \n\n \n \n\nGEO help: Mouse over screen elements for information.\n\nScope: SelfPlatformSamplesSeriesFamily\n Format: HTMLSOFTMINiML\n Amount: BriefQuick\n GEO accession: \n\n\n\n Sample GSM935277\n\nQuery DataSets for GSM935277\nStatus\nPublic on May 22, 2012\nTitle\nStanford_ChipSeq_GM12878_TBP_IgG-mus\nSample type\nSRA\n \n\nSource name\nGM12878\nOrganism\nHomo sapiens\nCharacteristics\nlab: Stanfordlab description: Snyder - Stanford Universitydatatype: ChipSeqdatatype description: Chromatin IP Sequencingcell: GM12878cell organism: humancell description: B-lymphocyte, lymphoblastoid, International HapMap Project - CEPH/Utah - European Caucasion, Epstein-Barr Viruscell karyotype: normalcell lineage: mesodermcell sex: Ftreatment: Nonetreatment description: No special treatment or protocol appliesantibody: TBPantibody antibodydescription: Mouse monoclonal. Immunogen is synthetic peptide conjugated to KLH derived from within residues 1 - 100 of HumanTATA binding protein TBP. Antibody Target: TBPantibody targetdescription: General transcription factor that functions at the core of the DNA-binding multiprotein factor TFIID. Binding of TFIID to the TATA box is the initial transcriptional step of the pre-initiation complex (PIC), playing a role in the activation of eukaryotic genes transcribed by RNA polymerase II."
What I want to do is to detect pattern in this form:
Antibody Target: TBPantibody
And return the substring result TBPantibody
.
I tried this regex but it doesn't work
sub("Antibody Target: ([A-Zaz]+)\\W+", "\\1", x)
What's the right way to do it?