Re: Extract part of a string
- From: Paul Lalli <mritty@xxxxxxxxx>
- Date: 30 Apr 2007 06:53:12 -0700
On Apr 30, 9:21 am, roopa...@xxxxxxxxx wrote:
Hi,
I want to extract everything between the hash signs in the following
string
"### This is a test ###"
I am using the following..
if($desc=~ /\#{3}(.*?)\#{3}/ )
{
print $1;
}
I am not getting the desired result. Please tell me what I am doing
wrong.
What you're doing wrong is not posting a short-but complete script
that demonstrates your error. Because what you have above *does*
work. So therefore you're doing something wrong in your actual code
that you haven't bothered to show us...
$ perl -e'
my $desc = "### This is a test ###";
if($desc=~ /\#{3}(.*?)\#{3}/ )
{
print $1;
}
'
Results: This is a test
Paul Lalli
.
- Follow-Ups:
- Re: Extract part of a string
- From: roopa . pd
- Re: Extract part of a string
- References:
- Extract part of a string
- From: roopa . pd
- Extract part of a string
- Prev by Date: Re: creating hash from scalar variable
- Next by Date: Re: creating hash from scalar variable
- Previous by thread: Extract part of a string
- Next by thread: Re: Extract part of a string
- Index(es):
Relevant Pages
|