Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Regex: Lines wh...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 10864 of 12002
Post > Topic >>

Regex: Lines where one pattern may not occure, but other pattern has

by maillists@[EMAIL PROTECTED] Apr 4, 2008 at 03:46 PM

Hi

I am trying to regex a make output line (g++) and don't get it together.
What I want is:

All lines where the -c option does not occure, neither before nor after
the -o option and then extract the ****tion after the -o option.

$regexApplication = '(?<![ \t]-c[ \t])-o[
\t]+((/?([\w\.]+/)*)?([\w]+(\.[\w]+)?))[ \t]+(?!.*[ \t]-c[ \t])';

$refStrAppl = \$1;

elsif( $inputLine =~ m/$regexApplication/ )
{
  push( @[EMAIL PROTECTED]
 $$refStrAppl );
}

How do I build a regex that checks for inexitstance of a certain pattern,
in my case [ \t]-c[ \t] and existance of another pattern, my case -o[
\t]+((/?([\w\.]+/)*)?([\w]+(\.[\w]+)?))[ \t]+    ? (last q-mark is not
regex) 

Or do I have to split it? I am close to do it that way. Not nice, but
simpler.

Appreciate any help

Cheers

Roman
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@[EMAIL
PROTECTED]

 




 3 Posts in Topic:
Regex: Lines where one pattern may not occure, but other pattern
maillists@[EMAIL PROTECTE  2008-04-04 15:46:01 
Re: Regex: Lines where one pattern may not occure, but other pat
yitzle@[EMAIL PROTECTED]   2008-04-04 09:20:44 
Re: Regex: Lines where one pattern may not occure, but other pat
rob.dixon@[EMAIL PROTECTE  2008-04-04 15:50:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 14:55:02 CDT 2008.