Can not catch substring by regex which ends with tab

I have two types of strings:

1: ANN=abcdefgh;blabla

2: ANN=abcdefghtyxztyxz

Now I want to extract the abcdefgh with a regex. So the start to extract is always after “ANN=”. But the end is eighter a semicolon (;) or the FIRST occurrence of a tab.

How does the regex for this look? I tried:

(my @splitUpAnn) = $tabValues[7] =~ /ANN=(.*)[;t]/;

But I always get just the version 1 with the semicolon back, but it does not work for version two…


Source: regex

Leave a Reply