ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activetcl
activetcl
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved