1 waarschijnlijk neiging tot suikerziekte ccaggcccac ctggagactc
and split it up in a part that containes the number
a part that containes the text
and as a last part the dna sequence ccaggcccac ctggagactc
now i can do that with the following code
Expand|Select|Wrap|Line Numbers
- # haal de ziekte codes er uit
- if($line =~ m/(\b[ctga]+\b)(.*)/)
- {
- $part3 = $1.$2;
- # haal het einde lijn teken eraf
- chop $part3;
- }
- # haal het nummer en de naam uit de string
- if($line =~ m/(\d+)(.*?)(\b[gtac]+\b)/)
- {
- # $1 = the numeric part, $2 the text
- # nu maken we een hash met het nummer als keyword
- $ziektenaamhash{$1} = $2;
- # we maken ook een hash waarbij het nummer verwijst
- $ziektehash{$1} = $part3;
- }
Is there a more efficient way to be split the lines in those parts or is my code just fine?