monkfan has asked for the wisdom of the Perl Monks concerning the following question:
Dear fellow monks,
I have these two strings:
Regards,
Edward
I have these two strings:
How can I extract element of $str2 that match with $str1, such that in the end the extraction just give this as results:my $str1 = 'AT1G71260'; my $str2 = 'AT1G71260_|_chr1';
Note that these two strings can contain any characters (even whitespace, semicolon(;), etc) and of any lengths.my $results = 'AT1G71260';
Regards,
Edward
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Match and Extract String with Regex
by ikegami (Patriarch) on Nov 17, 2007 at 01:47 UTC | |
by erroneousBollock (Curate) on Nov 17, 2007 at 09:25 UTC | |
by lima1 (Curate) on Nov 17, 2007 at 16:58 UTC | |
by erroneousBollock (Curate) on Nov 18, 2007 at 04:10 UTC | |
Re: Match and Extract String with Regex
by mwah (Hermit) on Nov 17, 2007 at 09:00 UTC | |
Re: Match and Extract String with Regex
by lima1 (Curate) on Nov 17, 2007 at 10:13 UTC |
Back to
Seekers of Perl Wisdom