Reputation: 179
I am using awk. I have several names like
rs123123789_G rs9888_A rs23789_GA rs23789_GASDFAS
I want to find the name start with rs and end with single character in awk (rs123123789_G, rs9888_A). I tried use
~/^rs[0-9]+[A-Z]$/
But it does not work.
Upvotes: 0
Views: 316
Reputation: 15461
You're missing the underscore :
~/^rs[0-9]+_[A-Z]$/
All the 3 names in your example are starting with rs
and all are ending with a single alphabetic character - G
, A
, S
respectively. Your requirement is that they should end with single alphabetic character after _
.
Upvotes: 2