Hi, all --

Can I compile a regexp as I can in perl?

We have various possible values that we want to strip out of a string and
we store them in an array so that users can update with their own.  To

  $noadobe =
        "File written by Adobe Photoshop",
        "LEAD Technologies Inc." ,
        "more pesky text" ,
      ) ;

We want to make it easy on the users, so we're not going to figure any
regular expressions belong in there; I'll just use a greedy .* to suck up
everything that starts with any of these matches.

In my code I can certainly 

  $noadoberegexp = "(" . join("|",$noadobe) . ").*" ;

and then

  $cleanstring = eregi_replace("$noadoberegexp","",$stripstring) ;

but 1) I haven't tested this code yet :-) and 2) I wonder if I'll run
into long runtimes when we get lots of strings to match.


David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg79099/pgp00000.pgp
Description: PGP signature

Reply via email to