LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   awk: how to match the character start with and end with (https://www.linuxquestions.org/questions/linux-newbie-8/awk-how-to-match-the-character-start-with-and-end-with-4175576274/)

Mike_Brown 03-30-2016 11:35 PM

awk: how to match the character start with and end with
 
I am using awk. I have several names like

Code:

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

Code:

~/^rs[0-9]+[A-Z]$/
But it does not work.

syg00 03-30-2016 11:47 PM

Including an underscore in your regex might help.


All times are GMT -5. The time now is 09:12 PM.