Re: [Activetcl] Help with regexp
by Robert M Bartis other posts by this author
Dec 23 2007 6:19AM messages near this date
view in the new Beta List Site
Re: [Activetcl] Help with regexp
|
[Activetcl] teacup questions
I believe what I need to use is a negative look-ahead. I tried the
following to no eval
{(?!Total number) (\S+)\s+(\d+)}
{(?!Total number (\S+)\s+(\d+))}
Robert M. Bartis
Stinger Quality Assurance
TEL: (908) 582-6566
EMAIL: bartis@[...].com
________________________________
From: Bartis, Robert M (Bob)
Sent: Sunday, December 23, 2007 8:00 AM
To: activetcl@[...].com
Subject: Help with regexp
I have a need to evaluate the following lines such that the
first regexp rule consumes or matches all but the last line of the
strings shown below:
asdd 3
jhiuya 5
as5ads 6
Total number of things above 3
The rule used for the first three lines is
(\S+)\s+(\d+)
and for the last line
(Total number of things above)\s+(\d+)
The problem I have is the first rule also is satisfied by the
last line (i.e asdd 3, jhiuya 5, as5ads 6, above 3). This causes
problems in my application. To resolve this I'd like to write a regexp
that says match one set of Ares' but not another, within a single
regexp.
Robert M. Bartis
Stinger Quality Assurance
TEL: (908) 582-6566
EMAIL: bartis@[...].com
Thread:
Robert M Bartis
Hillel Seltzer
Robert M Bartis
|