
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.

$var =~ m/^(.+?)\s.*/; KISS! and no that's no kiss but "keep is stupid and simple" ;-) L. Esther-Kristin Lather wrote:
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
-- ============================================================== Lieven Sterck, PhD Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be ============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson

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

Esther-Kristin Lather schreef:
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
use split ;) -- ================================================================== Sebastian Proost PhD Student Tel:+ 32 (0) 9 33 13 822 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM sebastian.proost@psb.vib-ugent.be http://www.psb.ugent.be ================================================================== "If I knew what I was doing, it wouldn't be called research." --Albert Einstein

aaahh, 8-) , the many ways of PERL !!! Sebastian Proost wrote:
Esther-Kristin Lather schreef:
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
use split ;)
-- ============================================================== Lieven Sterck, PhD Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be ============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson

I would paste it in Word, replace the spaces with a tabs, select the whole thing, copy it and paste it in Excel. Then select the column you need. That's what I call KIS. No need to mess around with Perl lieven sterck wrote:
aaahh, 8-) , the many ways of PERL !!!
Sebastian Proost wrote:
Esther-Kristin Lather schreef:
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
use split ;)
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari

if there wasn't an ocean separating us, I would smack you!!! O:-) L. Thomas Abeel wrote:
I would paste it in Word, replace the spaces with a tabs, select the whole thing, copy it and paste it in Excel. Then select the column you need.
That's what I call KIS. No need to mess around with Perl
lieven sterck wrote:
aaahh, 8-) , the many ways of PERL !!!
Sebastian Proost wrote:
Esther-Kristin Lather schreef:
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
use split ;)
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ============================================================== Lieven Sterck, PhD Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be ============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson

............................................________........................ ....................................,.-‘”...................``~.,.................. .............................,.-”...................................“-.,............ .........................,/...............................................”:,........ .....................,?......................................................\,..... .................../...........................................................,}.... ................./......................................................,:`^`..}.... .............../...................................................,:”........./..... ..............?.....__.........................................:`.........../..... ............./__.(.....“~-,_..............................,:`........../........ .........../(_....”~,_........“~,_....................,:`........_/........... ..........{.._$;_......”=,_.......“-,_.......,.-~-,},.~”;/....}........... ...........((.....*~_.......”=-._......“;,,./`..../”............../............ ...,,,___.\`~,......“~.,....................`.....}............../............. ............(....`=-,,.......`........................(......;_,,-”............... ............/.`~,......`-...............................\....../\................... .............\`~.*-,.....................................|,./.....\,__........... ,,_..........}.>-._\...................................|..............`=~-,.... .....`=~-,_\_......`\,.................................\........................ ...................`=~-,,.\,...............................\....................... ................................`:,,...........................`\..............__.. .....................................`=-,...................,%`>--==``....... ........................................_\..........._,-%.......`\............... ...................................,<`.._|_,-&``................`\.............. lieven sterck wrote:
if there wasn't an ocean separating us, I would smack you!!! O:-) L.
Thomas Abeel wrote:
I would paste it in Word, replace the spaces with a tabs, select the whole thing, copy it and paste it in Excel. Then select the column you need.
That's what I call KIS. No need to mess around with Perl
lieven sterck wrote:
aaahh, 8-) , the many ways of PERL !!!
Sebastian Proost wrote:
Esther-Kristin Lather schreef:
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
use split ;)
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ================================================================== Jonathan Gordon, Ph.D Tel:+32 (0)9 331 37 58 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM jogor@psb.vib-ugent.be http://www.psb.vib-ugent.be ==================================================================

I guess my problem is solved... ;-) (but one question remains in my head: So I can use the ? for non-greedy search only after a quantifier? Or also if I group something with round brackets?) Jonathan Gordon wrote:
............................................________........................
....................................,.-‘”...................``~.,..................
.............................,.-”...................................“-.,............
.........................,/...............................................”:,........
.....................,?......................................................\,.....
.................../...........................................................,}....
................./......................................................,:`^`..}....
.............../...................................................,:”........./.....
..............?.....__.........................................:`.........../.....
............./__.(.....“~-,_..............................,:`........../........
.........../(_....”~,_........“~,_....................,:`........_/...........
..........{.._$;_......”=,_.......“-,_.......,.-~-,},.~”;/....}........... ...........((.....*~_.......”=-._......“;,,./`..../”............../............
...,,,___.\`~,......“~.,....................`.....}............../.............
............(....`=-,,.......`........................(......;_,,-”...............
............/.`~,......`-...............................\....../\...................
.............\`~.*-,.....................................|,./.....\,__...........
,,_..........}.>-._\...................................|..............`=~-,....
.....`=~-,_\_......`\,.................................\........................
...................`=~-,,.\,...............................\.......................
................................`:,,...........................`\..............__..
.....................................`=-,...................,%`>--==``.......
........................................_\..........._,-%.......`\...............
...................................,<`.._|_,-&``................`\.............. lieven sterck wrote:
if there wasn't an ocean separating us, I would smack you!!! O:-) L.
Thomas Abeel wrote:
I would paste it in Word, replace the spaces with a tabs, select the whole thing, copy it and paste it in Excel. Then select the column you need.
That's what I call KIS. No need to mess around with Perl
lieven sterck wrote:
aaahh, 8-) , the many ways of PERL !!!
Sebastian Proost wrote:
Esther-Kristin Lather schreef:
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
use split ;)
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari

I'm guessing only after a quantifier .. L. Esther-Kristin Lather wrote:
I guess my problem is solved... ;-)
(but one question remains in my head: So I can use the ? for non-greedy search only after a quantifier? Or also if I group something with round brackets?)
Jonathan Gordon wrote:
............................................________........................
....................................,.-‘”...................``~.,..................
.............................,.-”...................................“-.,............
.........................,/...............................................”:,........
.....................,?......................................................\,.....
.................../...........................................................,}....
................./......................................................,:`^`..}....
.............../...................................................,:”........./.....
..............?.....__.........................................:`.........../.....
............./__.(.....“~-,_..............................,:`........../........
.........../(_....”~,_........“~,_....................,:`........_/...........
..........{.._$;_......”=,_.......“-,_.......,.-~-,},.~”;/....}........... ...........((.....*~_.......”=-._......“;,,./`..../”............../............
...,,,___.\`~,......“~.,....................`.....}............../.............
............(....`=-,,.......`........................(......;_,,-”...............
............/.`~,......`-...............................\....../\...................
.............\`~.*-,.....................................|,./.....\,__...........
,,_..........}.>-._\...................................|..............`=~-,....
.....`=~-,_\_......`\,.................................\........................
...................`=~-,,.\,...............................\.......................
................................`:,,...........................`\..............__..
.....................................`=-,...................,%`>--==``.......
........................................_\..........._,-%.......`\...............
...................................,<`.._|_,-&``................`\.............. lieven sterck wrote:
if there wasn't an ocean separating us, I would smack you!!! O:-) L.
Thomas Abeel wrote:
I would paste it in Word, replace the spaces with a tabs, select the whole thing, copy it and paste it in Excel. Then select the column you need.
That's what I call KIS. No need to mess around with Perl
lieven sterck wrote:
aaahh, 8-) , the many ways of PERL !!!
Sebastian Proost wrote:
Esther-Kristin Lather schreef:
> 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 > > > > > > use split ;)
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ============================================================== Lieven Sterck, PhD Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be ============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson

I'm not guessing, I looked it up ;) By default, a quantified subpattern is "greedy", that is, it will match as many times as possible (given a particular starting location) while still allowing the rest of the pattern to match. If you want it to match the minimum number of times possible, follow the quantifier with a "?". Note that the meanings don't change, just the "greediness": *? Match 0 or more times +? Match 1 or more times ?? Match 0 or 1 time {n}? Match exactly n times {n,}? Match at least n times {n,m}? Match at least n but not more than m times in a terminal do 'perldoc perlre' for full explanation :) -Kenny On Thu, 16 Apr 2009, lieven sterck wrote:
I'm guessing only after a quantifier ..
L.
Esther-Kristin Lather wrote:
I guess my problem is solved... ; -)
(but one question remains in my head: So I can use the ? for non-greedy search only after a quantifier? Or also if I group something with round brackets?)
Jonathan Gordon wrote:
............................................________........................
....................................,.-??...................``~.,..................
.............................,.-?...................................?-.,............
.........................,/...............................................?:,........
.....................,?......................................................\,.....
.................../...........................................................,}....
................./......................................................,:`^`..}....
.............../...................................................,:?........./.....
..............?.....__.........................................:`.........../.....
............./__.(.....?~-,_..............................,:`........../........
.........../(_....?~,_........?~,_....................,:`........_/...........
..........{.._$;_......?=,_.......?-,_.......,.-~-,},.~?;/....}........... ...........((.....*~_.......?=-._......?;,,./`..../?............../............
...,,,___.\`~,......?~.,....................`.....}............../.............
............(....`=-,,.......`........................(......;_,,-?...............
............/.`~,......`-...............................\....../\...................
.............\`~.*-,.....................................|,./.....\,__...........
,,_..........}.>-._\...................................|..............`=~-,....
.....`=~-,_\_......`\,.................................\........................
...................`=~-,,.\,...............................\.......................
................................`:,,...........................`\..............__..
.....................................`=-,...................,%`>--==``.......
........................................_\..........._,-%.......`\...............
...................................,<`.._|_,-&``................`\.............. lieven sterck wrote:
if there wasn't an ocean separating us, I would smack you!!! O:-) L.
Thomas Abeel wrote:
I would paste it in Word, replace the spaces with a tabs, select the whole thing, copy it and paste it in Excel. Then select the column you need.
That's what I call KIS. No need to mess around with Perl
lieven sterck wrote:
aaahh, 8-) , the many ways of PERL !!!
Sebastian Proost wrote:
> Esther-Kristin Lather schreef: > > > > > > 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 > > > > > > > > > > > > > use split ;) > > > > > -- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson
------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ============================================================== Lieven Sterck, PhD
Tel:+32 (0)9 3313821 Fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, UGent Bioinformatics and Evolutionary Genomics Division Technologiepark 927, B-9052 Gent, Belgium Email: lieven.sterck@psb.vib-ugent.be Website: http://bioinformatics.psb.ugent.be
============================================================== "Facts are meaningless. You could use facts to prove anything that's even remotely true!" H. Simpson ------------------------------------------------------------------------
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
_______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ================================================================== Kenny Billiau Web Developer Tel:+32 (0)9 331 36 95 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM kenny.billiau@ugent.be http://bioinformatics.psb.ugent.be ================================================================== "Never get out of the boat" -- Chef, APN

On Thu, 16 Apr 2009, Esther-Kristin Lather wrote:
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?
I don't really understand why you need a regex for this. Can't you split /\|/, $var; and afterwards check if the first part matches your regex?
Thanks for any suggestions! Esther. _______________________________________________ Binari Implicitly Neglects All Recursive Iterations https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ================================================================== Kenny Billiau Web Developer Tel:+32 (0)9 331 36 95 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM kenny.billiau@ugent.be http://bioinformatics.psb.ugent.be ================================================================== "Never get out of the boat" -- Chef, APN
participants (7)
-
Esther-Kristin Lather
-
Jonathan Gordon
-
Kenny Billiau
-
lieven sterck
-
Sebastian Proost
-
Thomas Abeel
-
Tine Blomme