fork download
  1. x = ">P04259 SWISS-PROT:P04259 Tax_Id=9606 Gene_Symbol=KRT6B Keratin, type II cytoskeletal 6B"
  2. gsub("^(?:>.*?(?:ENSEMBL:|SWISS-PROT:|TREMBL:))([A-Z0-9.-]+)(?:.*?Gene_Symbol=(\\S+)|\\s|;\\S+ |\\|\\S+)(.*?)(?:;>.*|$)", "\\1", x, perl = TRUE)
  3. gsub("^(?:>.*?(?:ENSEMBL:|SWISS-PROT:|TREMBL:))([A-Z0-9.-]+)(?:.*?Gene_Symbol=(\\S+)|\\s|;\\S+ |\\|\\S+)(.*?)(?:;>.*|$)", "\\2", x, perl = TRUE)
  4. gsub("^(?:>.*?(?:ENSEMBL:|SWISS-PROT:|TREMBL:))([A-Z0-9.-]+)(?:.*?Gene_Symbol=(\\S+)|\\s|;\\S+ |\\|\\S+)(.*?)(?:;>.*|$)", "\\3", x, perl = TRUE)
  5.  
Success #stdin #stdout 0.45s 79168KB
stdin
Standard input is empty
stdout
[1] "P04259"
[1] "KRT6B"
[1] " Keratin, type II cytoskeletal 6B"