>gi|77641047|gb|ABB00395.1| I2 [Lycopersicon esculentum] TRTPSTSLVVDSGIFGRQNEIEDLVGRLLSMDTKGKNLAVVPIVGMGGLGKTTLAKAVYNDERVKKHFGL TAWFCVSEAYDAFRITKGILQEIGSTDLKADHNLNQLQVKVKESLKGKKFLIVLDDVWNDNYNEWDDLRN IFVQGDIGSKIIVTTRKNSVALMMGNEQISMNNLSTEASWSLFKRHAFENMNPMGYPELEEVGKQIAAKC KGLPLALKTLAGMLCSKSEIDEWKRILRSEIW >gi|77641045|gb|ABB00394.1| I2 [Lycopersicon esculentum] TRTPSTSLVVDSGIFGRQNEIEDLVGRLLSMDTKGKNLAVVPIVGMGGLGKTTLAKAVYNDERVKKHFGL TAWFCVSEAYDAFRITKGILQEIGSTDLKADHNLNQLQVKVKESLKGKKFLIVLDDVWNDNYNEWDDLRN (many more lines repeated like this)
I want to build a regular expression to capture everything between the ">" including the first ">" but excluding the last ">"
I thought this would work. Assume $seqs holds all of the above data.
$seqs =~ /^(\>.*(?=\>))/ms;
It doesn't, rather it captures the entire file. The trick appears to be in how to express the .* so that it grabs only until the next ">". How does one do this?
In reply to Simple regular expression that isn't simple by ovo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |