ou want this?

my ($seq) = ($var =~m/^(.*_{0,1}\d+)\s.*?/);

adding the '?' makes the * stop after the first time the regex was found

Tine

Op 16-apr-09, om 17:30 heeft Esther-Kristin Lather het volgende geschreven:

Hi!

How can I make this Regex greedy?

my ($seq) = ($var =~m/^(.*_{0,1}\d+)\s.*/);

if $var is "ara_prot.tfa_3154 | AT1G26170.1 | no family",
I want to cut after the first whitespace
so that $seq becomes be "ara_prot.tfa_3154" and not "ara_prot.tfa_3154 |
AT1G26170.1".

I don't know where/ how to include the ? for non-greedy search. I would
want to do it with round brackets, but that violates the round brackets
I already use for getting a part of the string, no?

Thanks for any suggestions!
Esther.
_______________________________________________
Binari Implicitly Neglects All Recursive Iterations
https://maillist.psb.ugent.be/mailman/listinfo/binari