Re: grabbing text between two tokens
- From: noreply@xxxxxxxxx (Gunnar Hjalmarsson)
- Date: Tue, 15 Apr 2008 20:50:54 +0200
Sharan Basappa wrote:
Gary Stainburn wrote:On Monday 14 April 2008 16:35, Sharan Basappa wrote:I am trying to capture the text between two tokens. These tokens
always exist in pairs but can occur N times.
I somehow dont get what I want.
$str =~ m/tokena(.*)tokenb/ms;
print $1;
Try
$str =~ m/tokena(.*?)tokenb/ms;
actually I tried this before posting this question. The issue is that
regex stops after first match.
Show us a short but _complete_ program, and we can help you correct it.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- Follow-Ups:
- Re: grabbing text between two tokens
- From: Sharan Basappa
- Re: grabbing text between two tokens
- References:
- grabbing text between two tokens
- From: Sharan Basappa
- Re: grabbing text between two tokens
- From: Gary Stainburn
- Re: grabbing text between two tokens
- From: Sharan Basappa
- grabbing text between two tokens
- Prev by Date: Re: Getting more than one match with regexp
- Next by Date: Re: reg ex
- Previous by thread: Re: grabbing text between two tokens
- Next by thread: Re: grabbing text between two tokens
- Index(es):