The following are my strings:
I am using the following regex command in python: (Homo sapiens [^,]*)
outcome: Homo sapiens ribosomal protein lateral stalk subunit P0 (RPLP0) transcript variant 1 Homo sapiens N-alpha-acetyltransferase 20
expected outcomes are:
Homo sapiens ribosomal protein lateral stalk subunit P0 (RPLP0) transcript variant 1
Homo sapiens N-alpha-acetyltransferase 20, NatB catalytic subunit (NAA20), transcript variant 3
Kindly help me. Thanks in advance!
If 'transcript variant'
is always present in the data:
(Homo sapiens.* transcript variant [^,]*)
If ', mRNA'
is always present in the data:
(Homo sapiens.*)(?:, mRNA)
and get group1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.