To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 4444
4443  |  4445
Subject: 
Re: Regular Expression help?
Newsgroups: 
lugnet.off-topic.geek
Date: 
Tue, 8 Jul 2003 19:04:37 GMT
Viewed: 
462 times
  
Dan Boger wrote:
On Tue, Jul 08, 2003 at 05:51:08PM +0000, Andy Lynch wrote:
I think this will only find img tags that have a border property, but
I need to find img tags that are missing the border property.

doh, of course.  However, unless your editor allows to do negative
lookaheads, I don't think you can use a regexp to find a missing
border tag.

Ah.  I had my little O'Reilly Perl 5 pocket reference out and was playing
with "zero-width positive/negative look-ahead/behind assertion"s before I
began this thread, but since I haven't used them before I wasn't sure how
they worked.  In any case my editor's documentation doesn't mention them,
and my experiments wouldn't match anything when I tried to use them, so I
think it is safe to say that they are not implemented.


actually need to be changed. Also, the same editor that allows us to
use RegExpr for searching will allow us to use a syntax similar to
perl for replacement text. Of course I need to be able to capture
the offending text to be able to creatively replace it! hehehe.

hmmm.  One way to do it would be to replace all the img tags that DO
have the border attribute, with something else, like "<!img" or
something...  then, edit all the remaining img tags (because they are
missing the border attribute), and then replace all the "<!img" tags
with "<img" again.

:)

Sigh.  Of course, I think that would work.  I think the sheer number of
files involved and my insecurity with the regular expression replacement
process prevented my brain from considering that option.

Ok, I've started using this approach and it is working just fine. :-)
Thanks for the extra brain cells.

-Andy Lynch



Message is in Reply To:
  Re: Regular Expression help?
 
(...) doh, of course. However, unless your editor allows to do negative lookaheads, I don't think you can use a regexp to find a missing border tag. (...) hmmm. One way to do it would be to replace all the img tags that DO have the border attribute, (...) (21 years ago, 8-Jul-03, to lugnet.off-topic.geek)

11 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR