Re: Simple string search
- From: jordilin <jordilin@xxxxxxxxx>
- Date: Fri, 02 Nov 2007 14:06:14 -0700
On 2 nov, 21:39, spamb...@xxxxxxxxxx (Doug Miller) wrote:
In article <1194033024.617604.170...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, jordilin <jordi...@xxxxxxxxx> wrote:
Yes, there is more than one way to do it. This is Perl, isn't it? By
the way, can you explain the following regex?
m/id="(.{12})"/
I am not sure about this 12 between brackets.
. means "any character"
{12} means "whatever came just before this, we're looking for 12 of it".
So .{12} means "any sequence of exactly 12 characters", and (.{12}) means
"open paren, followed by any sequence of exactly 12 characters, followed by
close paren".
--
Regards,
Doug Miller (alphageek at milmac dot com)
It's time to throw all their damned tea in the harbor again.
Well, I understand. The problem is that, in this example the ids
differ in length, so it does not work here. We should write sth like
m/id="(.{7,})"/
match at least 7 times, taking into account there are no ids with less
than 7 chars.
Thanks
jordi
.
- Follow-Ups:
- Re: Simple string search
- From: Jürgen Exner
- Re: Simple string search
- References:
- Simple string search
- From: Jack
- Re: Simple string search
- From: jordilin
- Re: Simple string search
- From: Doug Miller
- Simple string search
- Prev by Date: Re: Simple string search
- Next by Date: Re: Simple string search
- Previous by thread: Re: Simple string search
- Next by thread: Re: Simple string search
- Index(es):
Relevant Pages
|