Andy,<br/>
<br/>
Thanks for the input.&nbsp; The original problem came from a co-worker of
mine who is limited by the third-party program that&nbsp; only allows the
simple regular expression in a text box, so the loop (which was my first
though, too) won't work.<br/>
<br/>
If I come up with anything that works I'll be sure to tell everyone.<br/>
<br/>
Dan<br/>
<br/>
On Sun, May 14, 2006 01:14, Andy Lester wrote:<br/>
&gt; On Sun, May 14, 2006 at 12:37:29AM -0500, Daniel Linder
(dan@linder.org)<br/>
&gt; wrote:<br/>
&gt;&gt; For example, this line:<br/>
&gt;&gt;<br/>
&gt;&gt; ^var1=(?i)(.*)(5705)(.*)<br/>
&gt;&gt;<br/>
&gt;&gt; will find all lines that begin with &quot;var1=&quot;, followed
byt any<br/>
&gt;&gt; characters, then 5705, then any other characters.  This filter
works<br/>
&gt;&gt; fine.<br/>
&gt; <br/>
&gt; Actually, that breaks down to<br/>
&gt; <br/>
&gt;     ^var1=      beginning of the line, and then &quot;var1=&quot;<br/>
&gt;     (?i)        an optional &quot;i&quot;<br/>
&gt;     (.*)        any string<br/>
&gt;     (5705)      the string &quot;5705&quot;<br/>
&gt;     (.*)        any other string<br/>
&gt; <br/>
&gt; The (.*) at the end is useless because it will always match in this<br/>
&gt; case, and at the end of the line, you don't care.<br/>
&gt; <br/>
&gt; <br/>
&gt;&gt; What I want to do is write a filter that finds the opposite
lines; i.e<br/>
&gt;&gt; all<br/>
&gt;&gt; lines that begin with &quot;var1=&quot; but do not have 5705 in
their<br/>
&gt;&gt; value.  I tried<br/>
&gt;&gt;<br/>
&gt;&gt; ^var1=(?i)(.*)(^5705)(.*)<br/>
&gt;&gt;<br/>
&gt;&gt; but that didn't work...<br/>
&gt; <br/>
&gt; That's because the ^ is only negation in a character set, as when
you<br/>
&gt; say [^aeiou] to mean &quot;any character except the vowels&quot;.<br/>
&gt; <br/>
&gt; Probably the simplest way to do this is to have two regexes.<br/>
&gt; <br/>
&gt;     if ( $line =~ /^var1=/ &amp;&amp; $line !~ /5705/ ) {<br/>
&gt; <br/>
&gt; This says &quot;If it starts with var1=, and it doesn't match 5705
anywhere&quot;,<br/>
&gt; then $line matches.<br/>
&gt; <br/>
&gt; xoa<br/>
&gt; --<br/>
&gt; Andy Lester =&gt; andy@petdance.com =&gt; www.petdance.com =&gt;
AIM:petdance<br/>
&gt; <br/>
<br/>
<br/>
- - - -<br/>
&quot;Wait for that wisest of all counselors, time.&quot; -- Pericles<br/>
&quot;I do not fear computers, I fear the lack of them.&quot; -- Isaac
Asimov<br/>
&quot;Soon we will be able to harness the rotational energy from Orwell's
grave to solve all world energy problems.&quot; -- /. user GigsVT
(208848)<br/>
GPG fingerprint:6FFD DB94 7B96 0FD8 EADF  2EE0 B2B0 CC47 4FDE 9B68