Re: Extract part of a string
- From: roopa.pd@xxxxxxxxx
- Date: 30 Apr 2007 11:47:07 -0700
On Apr 30, 9:53 am, Paul Lalli <mri...@xxxxxxxxx> wrote:
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- Hide quoted text -
- Show quoted text -
My String contains new line characters like
"This is a test
BEGIN PART INFORMATION##
5G5E-6010-AA|BLK ASY-CYL|
##END PART INFORMATION
"
So how do i modify my regexp
.
- Follow-Ups:
- Re: Extract part of a string
- From: Paul Lalli
- Re: Extract part of a string
- References:
- Extract part of a string
- From: roopa . pd
- Re: Extract part of a string
- From: Paul Lalli
- Extract part of a string
- Prev by Date: Re: unit messages
- Next by Date: Re: unit messages
- Previous by thread: Re: Extract part of a string
- Next by thread: Re: Extract part of a string
- Index(es):
Relevant Pages
|