in reply to Help with reg expressions

Ok, folks, I think some people are getting a little paranoid with the questions. Now, nearly every post asked for a clarification of the "(something)-disclose.gif". Now, we all know what happens when we assume, but really...this is a filename! I don't know what the hell kind of crazy operating systems you people are using, but have you ever seen any that allowed parentheses in a filename? Methinks y'all are just getting a wee bit persnickety. In any case, I think we can assume that the (???) can be safely replaced by
/\<img src=[a-zA-z0-9\.\_\-]...

Of course, anything can happen. One guy at work somehow ended up with a file named * on his Solaris machine. Yes, that's right, the file is named *. Of course, its a useless file, but he sure as hell doesn't want to delete it...

And somehow another guy ended up with a file named backspace. No, not the word backspace, the name of the file is actually the single character backspace. He hasn't tried to get rid of that one either.

But if you have any files like that, I suggest you don't trust it to an automated script to get rid of.

If you have any trouble sounding condescending, find a Unix user to show you how it's done.
- Scott Adams

Replies are listed 'Best First'.
Re: Re: Help with reg expressions
by chipmunk (Parson) on May 04, 2001 at 02:20 UTC
    I don't know what the hell kind of crazy operating systems you people are using, but have you ever seen any that allowed parentheses in a filename?
    If you have any trouble sounding condescending, find a Unix user to show you how it's done.
    - Scott Adams

    Does that answer your question? ;)

    Oh, and under MacOS, it's even easier to use filenames with parentheses in them, because you don't have to worry about escaping them.

Re (tilly) 2: Help with reg expressions
by tilly (Archbishop) on May 04, 2001 at 04:35 UTC
    Actually if you have a filename like that, I would use Perl to figure out how to name and delete it.

    BTW you can also use ANSI control characters in file names. That is a fun one...

Re: Re: Help with reg expressions
by elwarren (Priest) on May 04, 2001 at 04:25 UTC
    Agreed.

    Just look for any tag containing disclose.gif and remove the entire tag. If you want to get more indepth then write a grab anything between src= and disclose.gif.

    Sheesh, really not that bad.